Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
quorums_instantsend.cpp
Go to the documentation of this file.
52 void CInstantSendDb::WriteNewInstantSendLock(const uint256& hash, const CInstantSendLock& islock)
70 void CInstantSendDb::RemoveInstantSendLock(CDBBatch& batch, const uint256& hash, CInstantSendLockPtr islock)
92 static std::tuple<std::string, uint32_t, uint256> BuildInversedISLockKey(const std::string& k, int nHeight, const uint256& islockHash)
107 void CInstantSendDb::WriteInstantSendLockArchived(CDBBatch& batch, const uint256& hash, int nHeight)
113 std::unordered_map<uint256, CInstantSendLockPtr> CInstantSendDb::RemoveConfirmedInstantSendLocks(int nUntilHeight)
140 // archive the islock hash, so that we're still able to check if we've seen the islock in the past
157 auto firstKey = BuildInversedISLockKey(DB_ARCHIVED_BY_HEIGHT_AND_HASH, nUntilHeight, uint256());
302 std::vector<uint256> CInstantSendDb::RemoveChainedInstantSendLocks(const uint256& islockHash, const uint256& txid, int nHeight)
359 workThread = std::thread(&TraceThread<std::function<void()> >, "instantsend", std::function<void()>(std::bind(&CInstantSendManager::WorkThreadMain, this)));
383 bool CInstantSendManager::ProcessTx(const CTransaction& tx, bool allowReSigning, const Consensus::Params& params)
402 // In case the islock was received before the TX, filtered announcement might have missed this islock because
403 // we were unable to check for filter matches deep inside the TX. Now we have the TX, so we should retry.
415 LogPrint(BCLog::INSTANTSEND, "CInstantSendManager::%s -- txid=%s: CheckCanLock returned false\n", __func__,
439 LogPrintf("CInstantSendManager::%s -- txid=%s: input %s is conflicting with previous vote for tx %s\n", __func__,
448 LogPrintf("CInstantSendManager::%s -- txid=%s: quorumSigningManager->IsConflicting returned true. id=%s\n", __func__,
454 LogPrint(BCLog::INSTANTSEND, "CInstantSendManager::%s -- txid=%s: already voted on all inputs, bailing out\n", __func__,
459 LogPrint(BCLog::INSTANTSEND, "CInstantSendManager::%s -- txid=%s: trying to vote on %d inputs\n", __func__,
466 LogPrint(BCLog::INSTANTSEND, "CInstantSendManager::%s -- txid=%s: trying to vote on input %s with id %s. allowReSigning=%d\n", __func__,
469 LogPrint(BCLog::INSTANTSEND, "CInstantSendManager::%s -- txid=%s: voted on input %s with id %s\n", __func__,
474 // We might have received all input locks before we got the corresponding TX. In this case, we have to sign the
481 bool CInstantSendManager::CheckCanLock(const CTransaction& tx, bool printDebug, const Consensus::Params& params)
498 bool CInstantSendManager::CheckCanLock(const COutPoint& outpoint, bool printDebug, const uint256& txHash, CAmount* retValue, const Consensus::Params& params)
503 // if prevout was ix locked, allow locking of descendants (no matter if prevout is in mempool or already mined)
510 LogPrint(BCLog::INSTANTSEND, "CInstantSendManager::%s -- txid=%s: parent mempool TX %s is not locked\n", __func__,
518 // this relies on enabled txindex and won't work if we ever try to remove the requirement for txindex for masternodes
521 LogPrint(BCLog::INSTANTSEND, "CInstantSendManager::%s -- txid=%s: failed to find parent TX %s\n", __func__,
536 if (!llmq::chainLocksHandler->HasChainLock(pindexMined->nHeight, pindexMined->GetBlockHash())) {
538 LogPrint(BCLog::INSTANTSEND, "CInstantSendManager::%s -- txid=%s: outpoint %s too new and not ChainLocked. nTxAge=%d, nInstantSendConfirmationsRequired=%d\n", __func__,
582 void CInstantSendManager::HandleNewInputLockRecoveredSig(const CRecoveredSig& recoveredSig, const uint256& txid)
594 LogPrint(BCLog::INSTANTSEND, "CInstantSendManager::%s -- txid=%s: got recovered sig for input %s\n", __func__,
615 LogPrint(BCLog::INSTANTSEND, "CInstantSendManager::%s -- txid=%s: got all recovered sigs, creating CInstantSendLock\n", __func__,
642 void CInstantSendManager::HandleNewInstantSendLockRecoveredSig(const llmq::CRecoveredSig& recoveredSig)
659 LogPrintf("CInstantSendManager::%s -- txid=%s: islock conflicts with %s, dropping own version\n", __func__,
668 void CInstantSendManager::ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStream& vRecv, CConnman& connman)
681 void CInstantSendManager::ProcessMessageInstantSendLock(CNode* pfrom, const llmq::CInstantSendLock& islock, CConnman& connman)
702 LogPrint(BCLog::INSTANTSEND, "CInstantSendManager::%s -- txid=%s, islock=%s: received islock, peer=%d\n", __func__,
708 bool CInstantSendManager::PreVerifyInstantSendLock(NodeId nodeId, const llmq::CInstantSendLock& islock, bool& retBan)
734 // only process a max 32 locks at a time to avoid duplicate verification of recovered signatures which have been
779 std::unordered_set<uint256> CInstantSendManager::ProcessPendingInstantSendLocks(int signOffset, const std::unordered_map<uint256, std::pair<NodeId, CInstantSendLock>, StaticSaltedHasher>& pend, bool ban)
816 batchVerifier.PushMessage(nodeId, hash, signHash, islock.sig.Get(), quorum->qc.quorumPublicKey);
819 // We can reconstruct the CRecoveredSig objects from the islock and pass it to the signing manager, which
820 // avoids unnecessary double-verification of the signature. We however only do this when verification here
839 LogPrint(BCLog::INSTANTSEND, "CInstantSendManager::%s -- verified locks. count=%d, alreadyVerified=%d, vt=%d, nodes=%d\n", __func__,
847 // Let's not be too harsh, as the peer might simply be unlucky and might have sent us an old lock which
858 LogPrint(BCLog::INSTANTSEND, "CInstantSendManager::%s -- txid=%s, islock=%s: invalid sig in islock, peer=%d\n", __func__,
866 // See comment further on top. We pass a reconstructed recovered sig to the signing manager to avoid
874 LogPrint(BCLog::INSTANTSEND, "CInstantSendManager::%s -- txid=%s, islock=%s: passing reconstructed recSig to signing mgr, peer=%d\n", __func__,
884 void CInstantSendManager::ProcessInstantSendLock(NodeId from, const uint256& hash, const CInstantSendLock& islock)
894 // we ignore failure here as we must be able to propagate the lock even if we don't have the TX locally
902 // Let's see if the TX that was locked by this islock is already mined in a ChainLocked block. If yes,
905 LogPrint(BCLog::INSTANTSEND, "CInstantSendManager::%s -- txlock=%s, islock=%s: dropping islock as it already got a ChainLock in block %s, peer=%d\n", __func__,
915 LogPrint(BCLog::INSTANTSEND, "CInstantSendManager::%s -- txid=%s, islock=%s: processsing islock, peer=%d\n", __func__,
927 LogPrintf("CInstantSendManager::%s -- txid=%s, islock=%s: duplicate islock, other islock=%s, peer=%d\n", __func__,
933 LogPrintf("CInstantSendManager::%s -- txid=%s, islock=%s: conflicting input in islock. input=%s, other islock=%s, peer=%d\n", __func__,
934 islock.txid.ToString(), hash.ToString(), in.ToStringShort(), ::SerializeHash(*otherIsLock).ToString(), from);
946 // We don't need the recovered sigs for the inputs anymore. This prevents unnecessary propagation of these sigs.
955 // we don't have the TX yet, so we only filter based on txid. Later when that TX arrives, we will re-announce
965 void CInstantSendManager::UpdateWalletTransaction(const CTransactionRef& tx, const CInstantSendLock& islock)
976 void CInstantSendManager::ProcessNewTransaction(const CTransactionRef& tx, const CBlockIndex* pindex, bool allowReSigning)
1002 bool chainlocked = pindex && chainLocksHandler->HasChainLock(pindex->nHeight, pindex->GetBlockHash());
1022 void CInstantSendManager::BlockConnected(const std::shared_ptr<const CBlock>& pblock, const CBlockIndex* pindex, const std::vector<CTransactionRef>& vtxConflicted)
1040 void CInstantSendManager::BlockDisconnected(const std::shared_ptr<const CBlock>& pblock, const CBlockIndex* pindexDisconnected)
1051 void CInstantSendManager::AddNonLockedTx(const CTransactionRef& tx, const CBlockIndex* pindexMined)
1109 LogPrint(BCLog::INSTANTSEND, "CInstantSendManager::%s -- txid=%s, retryChildren=%d, retryChildrenCount=%d\n", __func__,
1131 quorumSigningManager->TruncateRecoveredSig(consensusParams.llmqTypeInstantSend, inputRequestId);
1143 bool fDIP0008Active = VersionBitsState(pindexNew->pprev, Params().GetConsensus(), Consensus::DEPLOYMENT_DIP0008, versionbitscache) == THRESHOLD_ACTIVE;
1172 LogPrint(BCLog::INSTANTSEND, "CInstantSendManager::%s -- txid=%s, islock=%s: removed islock as it got fully confirmed\n", __func__,
1175 // No need to keep recovered sigs for fully confirmed IS locks, as there is no chance for conflicts
1179 // And we don't need the recovered sig for the ISLOCK anymore, as the block in which it got mined is considered
1181 quorumSigningManager->TruncateRecoveredSig(consensusParams.llmqTypeInstantSend, islock->GetRequestId());
1184 // Find all previously unlocked TXs that got locked by this fully confirmed (ChainLock) block and remove them
1185 // from the nonLockedTxs map. Also collect all children of these TXs and mark them for retrying of IS locking.
1200 void CInstantSendManager::RemoveMempoolConflictsForLock(const uint256& hash, const CInstantSendLock& islock)
1215 LogPrintf("CInstantSendManager::%s -- txid=%s, islock=%s: mempool TX %s with input %s conflicts with islock\n", __func__,
1216 islock.txid.ToString(), hash.ToString(), it->second->GetHash().ToString(), in.ToStringShort());
1236 void CInstantSendManager::ResolveBlockConflicts(const uint256& islockHash, const llmq::CInstantSendLock& islock)
1239 std::unordered_map<const CBlockIndex*, std::unordered_map<uint256, CTransactionRef, StaticSaltedHasher>> conflicts;
1257 LogPrintf("CInstantSendManager::%s -- txid=%s, islock=%s: mined TX %s with input %s and mined in block %s conflicts with islock\n", __func__,
1258 islock.txid.ToString(), islockHash.ToString(), conflictTxid.ToString(), in.ToStringShort(), info.pindexMined->GetBlockHash().ToString());
1274 // If a conflict was mined into a ChainLocked block, then we have no other choice and must prune the ISLOCK and all
1275 // chained ISLOCKs that build on top of this one. The probability of this is practically zero and can only happen
1276 // when large parts of the masternode network are controlled by an attacker. In this case we must still find consensus
1294 LogPrintf("CInstantSendManager::%s -- invalidating block %s\n", __func__, pindex->GetBlockHash().ToString());
1301 LogPrintf("CInstantSendManager::%s -- InvalidateBlock failed: %s\n", __func__, FormatStateMessage(state));
1311 LogPrintf("CChainLocksHandler::%s -- ActivateBestChain failed: %s\n", __func__, FormatStateMessage(state));
1318 void CInstantSendManager::RemoveChainLockConflictingLock(const uint256& islockHash, const llmq::CInstantSendLock& islock)
1320 LogPrintf("CInstantSendManager::%s -- txid=%s, islock=%s: at least one conflicted TX already got a ChainLock. Removing ISLOCK and its chained children.\n", __func__,
1331 LogPrintf("CInstantSendManager::%s -- txid=%s, islock=%s: removed (child) ISLOCK %s\n", __func__,
1349 LogPrintf("CInstantSendManager::%s -- txid=%s: asking other peer %d for correct TX\n", __func__,
1405 // CheckCanLock is already called by ProcessTx, so we should avoid calling it twice. But we also shouldn't spam
1411 LogPrint(BCLog::INSTANTSEND, "CInstantSendManager::%s -- txid=%s: retrying to lock\n", __func__,
1421 LogPrint(BCLog::INSTANTSEND, "CInstantSendManager::%s -- retried %d TXs. nonLockedTxs.size=%d\n", __func__,
1435 return db.GetInstantSendLockByHash(inv.hash) != nullptr || pendingInstantSendLocks.count(inv.hash) != 0 || db.HasArchivedInstantSendLock(inv.hash);
1438 bool CInstantSendManager::GetInstantSendLockByHash(const uint256& hash, llmq::CInstantSendLock& ret)
void AddNonLockedTx(const CTransactionRef &tx, const CBlockIndex *pindexMined)
Definition: quorums_instantsend.cpp:1051
void RequestObject(CNodeState *state, const CInv &inv, std::chrono::microseconds current_time, bool fForce=false) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Definition: net_processing.cpp:769
void PushMessage(const SourceId &sourceId, const MessageId &msgId, const uint256 &msgHash, const CBLSSignature &sig, const CBLSPublicKey &pubKey)
Definition: bls_batchverifier.h:47
void UpdateWalletTransaction(const CTransactionRef &tx, const CInstantSendLock &islock)
Definition: quorums_instantsend.cpp:965
CTxMemPool mempool
void InterruptWorkerThread()
Definition: quorums_instantsend.cpp:378
Definition: spork.h:28
void RemoveInstantSendLockMined(const uint256 &hash, int nHeight)
Definition: quorums_instantsend.cpp:102
void TruncateRecoveredSigsForInputs(const CInstantSendLock &islock)
Definition: quorums_instantsend.cpp:1124
bool sleep_for(std::chrono::milliseconds rel_time)
Definition: threadinterrupt.cpp:27
void ResolveBlockConflicts(const uint256 &islockHash, const CInstantSendLock &islock)
Definition: quorums_instantsend.cpp:1236
static const std::string DB_ARCHIVED_BY_HEIGHT_AND_HASH
Definition: quorums_instantsend.cpp:37
static uint256 BuildSignHash(Consensus::LLMQType llmqType, const uint256 &quorumHash, const uint256 &id, const uint256 &msgHash)
Definition: quorums_utils.cpp:37
bool GetTransaction(const uint256 &hash, CTransactionRef &txOut, const Consensus::Params &consensusParams, uint256 &hashBlock, bool fAllowSlow, CBlockIndex *blockIndex)
Return transaction in txOut, and if it was found inside a block, its hash is placed in hashBlock...
Definition: validation.cpp:950
void removeRecursive(const CTransaction &tx, MemPoolRemovalReason reason=MemPoolRemovalReason::UNKNOWN)
Definition: txmempool.cpp:725
void PushReconstructedRecoveredSig(const CRecoveredSig &recoveredSig, const CQuorumCPtr &quorum)
Definition: quorums_signing.cpp:743
void BlockDisconnected(const std::shared_ptr< const CBlock > &pblock, const CBlockIndex *pindexDisconnected)
Definition: quorums_instantsend.cpp:1040
CInstantSendLockPtr GetInstantSendLockByInput(const COutPoint &outpoint)
Definition: quorums_instantsend.cpp:254
void TransactionAddedToMempool(const CTransactionRef &tx)
Definition: quorums_instantsend.cpp:1017
bool InvalidateBlock(CValidationState &state, const CChainParams &chainparams, CBlockIndex *pindex)
Mark a block as invalid.
Definition: validation.cpp:3180
bool HasChainLock(int nHeight, const uint256 &blockHash)
Definition: quorums_chainlocks.cpp:608
Definition: protocol.h:399
unordered_lru_cache< uint256, uint256, StaticSaltedHasher, 10000 > txidCache
Definition: quorums_instantsend.h:49
bool AlreadyHave(const CInv &inv)
Definition: quorums_instantsend.cpp:1428
void ProcessNewTransaction(const CTransactionRef &tx, const CBlockIndex *pindex, bool allowReSigning)
Definition: quorums_instantsend.cpp:976
static const std::string DB_ARCHIVED_BY_HASH
Definition: quorums_instantsend.cpp:38
void RegisterRecoveredSigsListener(CRecoveredSigsListener *l)
Definition: quorums_signing.cpp:771
Definition: dbwrapper.h:197
void HandleNewInputLockRecoveredSig(const CRecoveredSig &recoveredSig, const uint256 &txid)
Definition: quorums_instantsend.cpp:582
static const std::string DB_MINED_BY_HEIGHT_AND_HASH
Definition: quorums_instantsend.cpp:36
void TrySignInstantSendLock(const CTransaction &tx)
Definition: quorums_instantsend.cpp:604
void ProcessMessageInstantSendLock(CNode *pfrom, const CInstantSendLock &islock, CConnman &connman)
Definition: quorums_instantsend.cpp:681
Double ended buffer combining vector and stream-like interfaces.
Definition: streams.h:103
Definition: deterministicmns.h:26
bool AsyncSignIfMember(Consensus::LLMQType llmqType, const uint256 &id, const uint256 &msgHash, bool allowReSign=false)
Definition: quorums_signing.cpp:784
bool ProcessPendingInstantSendLocks()
Definition: quorums_instantsend.cpp:728
Definition: saltedhasher.h:64
std::unordered_map< uint256, std::pair< NodeId, CInstantSendLock >, StaticSaltedHasher > pendingInstantSendLocks
Definition: quorums_instantsend.h:100
void RemoveConflictedTx(const CTransaction &tx)
Definition: quorums_instantsend.cpp:1113
void AskNodesForLockedTx(const uint256 &txid)
Definition: quorums_instantsend.cpp:1336
void WorkThreadMain()
Definition: quorums_instantsend.cpp:1504
bool ActivateBestChain(CValidationState &state, const CChainParams &chainparams, std::shared_ptr< const CBlock > pblock)
Find the best known block, and make it the tip of the block chain.
Definition: validation.cpp:3072
indirectmap< COutPoint, const CTransaction * > mapNextTx
Definition: txmempool.h:538
void UnregisterRecoveredSigsListener(CRecoveredSigsListener *l)
Definition: quorums_signing.cpp:777
bool HasRecoveredSig(Consensus::LLMQType llmqType, const uint256 &id, const uint256 &msgHash)
Definition: quorums_signing.cpp:846
Definition: spork.h:24
Definition: params.h:22
CInstantSendManager * quorumInstantSendManager
Definition: quorums_instantsend.cpp:40
Definition: quorums_instantsend.h:20
bool GetInstantSendLockHashByTxid(const uint256 &txid, uint256 &ret)
Definition: quorums_instantsend.cpp:1453
bool HasArchivedInstantSendLock(const uint256 &islockHash)
Definition: quorums_instantsend.cpp:182
void insert(const Key &key, const Value &v)
Definition: unordered_lru_cache.h:49
uint256 SerializeHash(const T &obj, int nType=SER_GETHASH, int nVersion=PROTOCOL_VERSION)
Compute the 256-bit hash of an object's serialization.
Definition: hash.h:254
void Misbehaving(NodeId pnode, int howmuch, const std::string &message)
Increase a node's misbehavior score.
Definition: net_processing.cpp:1024
std::unordered_set< uint256, StaticSaltedHasher > inputRequestIds
Request ids of inputs that we signed.
Definition: quorums_instantsend.h:88
uint256 GetRequestId() const
Definition: quorums_instantsend.cpp:42
int nInstantSendConfirmationsRequired
Definition: params.h:137
CQuorumCPtr SelectQuorumForSigning(Consensus::LLMQType llmqType, const uint256 &selectionHash, int signHeight=-1, int signOffset=SIGN_HEIGHT_OFFSET)
Definition: quorums_signing.cpp:895
void RemoveChainLockConflictingLock(const uint256 &islockHash, const CInstantSendLock &islock)
Definition: quorums_instantsend.cpp:1318
Removed for block.
Definition: params.h:50
static const std::string DB_ISLOCK_BY_HASH
Definition: quorums_instantsend.cpp:33
std::shared_ptr< CInstantSendLock > CInstantSendLockPtr
Definition: quorums_instantsend.h:41
bool IsLocked(const uint256 &txHash)
Definition: quorums_instantsend.cpp:1464
void ProcessInstantSendLock(NodeId from, const uint256 &hash, const CInstantSendLock &islock)
Definition: quorums_instantsend.cpp:884
void HandleFullyConfirmedBlock(const CBlockIndex *pindex)
Definition: quorums_instantsend.cpp:1158
std::unordered_map< uint256, NonLockedTxInfo, StaticSaltedHasher > nonLockedTxs
Definition: quorums_instantsend.h:109
CInstantSendLockPtr GetConflictingLock(const CTransaction &tx)
Definition: quorums_instantsend.cpp:1479
size_t GetUniqueSourceCount() const
Definition: bls_batchverifier.h:66
An outpoint - a combination of a transaction hash and an index n into its vout.
Definition: transaction.h:26
void AddTransactionsUpdated(unsigned int n)
Definition: txmempool.cpp:356
void WriteNewInstantSendLock(const uint256 &hash, const CInstantSendLock &islock)
Definition: quorums_instantsend.cpp:52
Definition: quorums_signing.h:21
bool GetInstantSendLockByHash(const uint256 &hash, CInstantSendLock &ret)
Definition: quorums_instantsend.cpp:1438
void UpdatedBlockTip(const CBlockIndex *pindexNew)
Definition: quorums_instantsend.cpp:1140
static std::tuple< std::string, uint32_t, uint256 > BuildInversedISLockKey(const std::string &k, int nHeight, const uint256 &islockHash)
Definition: quorums_instantsend.cpp:92
CInstantSendManager(CDBWrapper &_llmqDb)
Definition: quorums_instantsend.cpp:342
void NotifyChainLock(const CBlockIndex *pindexChainLock)
Definition: quorums_instantsend.cpp:1135
bool PreVerifyInstantSendLock(NodeId nodeId, const CInstantSendLock &islock, bool &retBan)
Definition: quorums_instantsend.cpp:708
Definition: versionbits.h:24
void WriteInstantSendLockMined(const uint256 &hash, int nHeight)
Definition: quorums_instantsend.cpp:97
size_t GetInstantSendLockCount()
Definition: quorums_instantsend.cpp:1499
bool Write(const K &key, const V &value, bool fSync=false)
Definition: dbwrapper.h:298
CInstantSendLockPtr GetInstantSendLockByHash(const uint256 &hash)
Definition: quorums_instantsend.cpp:209
std::string FormatStateMessage(const CValidationState &state)
Convert CValidationState to a human-readable message for logging.
Definition: validation.cpp:513
std::vector< uint256 > GetInstantSendLocksByParent(const uint256 &parent)
Definition: quorums_instantsend.cpp:273
bool IsConflicting(Consensus::LLMQType llmqType, const uint256 &id, const uint256 &msgHash)
Definition: quorums_signing.cpp:869
bool HasRecoveredSigForId(Consensus::LLMQType llmqType, const uint256 &id)
Definition: quorums_signing.cpp:851
The block chain is a tree shaped structure starting with the genesis block at the root...
Definition: chain.h:170
const CChainParams & Params()
Return the currently selected parameters.
Definition: chainparams.cpp:947
void RemoveNonLockedTx(const uint256 &txid, bool retryChildren)
Definition: quorums_instantsend.cpp:1075
std::unordered_map< uint256, CInstantSendLockPtr > RemoveConfirmedInstantSendLocks(int nUntilHeight)
Definition: quorums_instantsend.cpp:113
CThreadInterrupt workInterrupt
Definition: quorums_instantsend.h:82
CInstantSendLockPtr GetInstantSendLockByTxid(const uint256 &txid)
Definition: quorums_instantsend.cpp:245
uint256 GetInstantSendLockHashByTxid(const uint256 &txid)
Definition: quorums_instantsend.cpp:225
void RemoveArchivedInstantSendLocks(int nUntilHeight)
Definition: quorums_instantsend.cpp:153
void RemoveInstantSendLock(CDBBatch &batch, const uint256 &hash, CInstantSendLockPtr islock)
Definition: quorums_instantsend.cpp:70
Definition: util.h:135
bool ProcessTx(const CTransaction &tx, bool allowReSigning, const Consensus::Params ¶ms)
Definition: quorums_instantsend.cpp:383
Definition: bls_batchverifier.h:14
void HandleNewInstantSendLockRecoveredSig(const CRecoveredSig &recoveredSig)
Definition: quorums_instantsend.cpp:642
static const std::string INPUTLOCK_REQUESTID_PREFIX
Definition: quorums_instantsend.cpp:30
void EraseObjectRequest(CNodeState *nodestate, const CInv &inv) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Definition: net_processing.cpp:676
void WriteInstantSendLockArchived(CDBBatch &batch, const uint256 &hash, int nHeight)
Definition: quorums_instantsend.cpp:107
void RemoveMempoolConflictsForLock(const uint256 &hash, const CInstantSendLock &islock)
Definition: quorums_instantsend.cpp:1200
static const std::string ISLOCK_REQUESTID_PREFIX
Definition: quorums_instantsend.cpp:31
Definition: protocol.h:425
size_t GetInstantSendLockCount()
Definition: quorums_instantsend.cpp:187
bool WriteBatch(CDBBatch &batch, bool fSync=false)
Definition: dbwrapper.cpp:157
~CInstantSendManager()
Definition: quorums_instantsend.cpp:348
The basic transaction that is broadcasted on the network and contained in blocks. ...
Definition: transaction.h:198
bool IsSporkActive(SporkId nSporkID)
IsSporkActive returns a bool for time-based sporks, and should be used to determine whether the spork...
Definition: spork.cpp:211
const Consensus::Params & GetConsensus() const
Definition: chainparams.h:54
std::unordered_map< uint256, CInstantSendLock, StaticSaltedHasher > creatingInstantSendLocks
These are the islocks that are currently in the middle of being created.
Definition: quorums_instantsend.h:95
CBlockIndex * GetAncestor(int height)
Efficiently find an ancestor of this block.
Definition: chain.cpp:110
CChain & chainActive
The currently-connected chain of blocks (protected by cs_main).
Definition: validation.cpp:217
AssertLockHeld(g_cs_orphans)
bool CheckCanLock(const CTransaction &tx, bool printDebug, const Consensus::Params ¶ms)
Definition: quorums_instantsend.cpp:481
ThresholdState VersionBitsState(const CBlockIndex *pindexPrev, const Consensus::Params ¶ms, Consensus::DeploymentPos pos, VersionBitsCache &cache)
Definition: versionbits.cpp:245
std::unordered_set< uint256, StaticSaltedHasher > pendingRetryTxs
Definition: quorums_instantsend.h:112
void BlockConnected(const std::shared_ptr< const CBlock > &pblock, const CBlockIndex *pindex, const std::vector< CTransactionRef > &vtxConflicted)
Definition: quorums_instantsend.cpp:1022
void ProcessMessage(CNode *pfrom, const std::string &strCommand, CDataStream &vRecv, CConnman &connman)
Definition: quorums_instantsend.cpp:668
bool ProcessPendingRetryLockTxs()
Definition: quorums_instantsend.cpp:1361
Definition: serialize.h:162
std::unordered_map< uint256, CInstantSendLock *, StaticSaltedHasher > txToCreatingInstantSendLocks
Definition: quorums_instantsend.h:97
std::vector< uint256 > RemoveChainedInstantSendLocks(const uint256 &islockHash, const uint256 &txid, int nHeight)
Definition: quorums_instantsend.cpp:302
virtual void HandleNewRecoveredSig(const CRecoveredSig &recoveredSig)
Definition: quorums_instantsend.cpp:552
bool IsConflicted(const CTransaction &tx)
Definition: quorums_instantsend.cpp:1474
static const std::string DB_HASH_BY_OUTPOINT
Definition: quorums_instantsend.cpp:35
void TruncateRecoveredSig(Consensus::LLMQType llmqType, const uint256 &id)
Definition: quorums_signing.cpp:751
void NotifyTransactionLock(const CTransaction &tx, const llmq::CInstantSendLock &islock)
Definition: validationinterface.cpp:226
bool GetVoteForId(Consensus::LLMQType llmqType, const uint256 &id, uint256 &msgHashRet)
Definition: quorums_signing.cpp:890
unordered_lru_cache< uint256, CInstantSendLockPtr, StaticSaltedHasher, 10000 > islockCache
Definition: quorums_instantsend.h:48
unordered_lru_cache< COutPoint, uint256, SaltedOutpointHasher, 10000 > outpointCache
Definition: quorums_instantsend.h:50
std::unordered_map< COutPoint, uint256, SaltedOutpointHasher > nonLockedTxsByOutpoints
Definition: quorums_instantsend.h:110