Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

llmq::CInstantSendManager Class Reference

#include <quorums_instantsend.h>

+ Inheritance diagram for llmq::CInstantSendManager:
+ Collaboration diagram for llmq::CInstantSendManager:

Classes

struct  NonLockedTxInfo
 

Public Member Functions

 CInstantSendManager (CDBWrapper &_llmqDb)
 
 ~CInstantSendManager ()
 
void Start ()
 
void Stop ()
 
void InterruptWorkerThread ()
 
bool ProcessTx (const CTransaction &tx, bool allowReSigning, const Consensus::Params &params)
 
bool CheckCanLock (const CTransaction &tx, bool printDebug, const Consensus::Params &params)
 
bool CheckCanLock (const COutPoint &outpoint, bool printDebug, const uint256 &txHash, CAmount *retValue, const Consensus::Params &params)
 
bool IsLocked (const uint256 &txHash)
 
bool IsConflicted (const CTransaction &tx)
 
CInstantSendLockPtr GetConflictingLock (const CTransaction &tx)
 
virtual void HandleNewRecoveredSig (const CRecoveredSig &recoveredSig)
 
void HandleNewInputLockRecoveredSig (const CRecoveredSig &recoveredSig, const uint256 &txid)
 
void HandleNewInstantSendLockRecoveredSig (const CRecoveredSig &recoveredSig)
 
void TrySignInstantSendLock (const CTransaction &tx)
 
void ProcessMessage (CNode *pfrom, const std::string &strCommand, CDataStream &vRecv, CConnman &connman)
 
void ProcessMessageInstantSendLock (CNode *pfrom, const CInstantSendLock &islock, CConnman &connman)
 
bool PreVerifyInstantSendLock (NodeId nodeId, const CInstantSendLock &islock, bool &retBan)
 
bool ProcessPendingInstantSendLocks ()
 
std::unordered_set< uint256ProcessPendingInstantSendLocks (int signOffset, const std::unordered_map< uint256, std::pair< NodeId, CInstantSendLock >, StaticSaltedHasher > &pend, bool ban)
 
void ProcessInstantSendLock (NodeId from, const uint256 &hash, const CInstantSendLock &islock)
 
void UpdateWalletTransaction (const CTransactionRef &tx, const CInstantSendLock &islock)
 
void ProcessNewTransaction (const CTransactionRef &tx, const CBlockIndex *pindex, bool allowReSigning)
 
void TransactionAddedToMempool (const CTransactionRef &tx)
 
void BlockConnected (const std::shared_ptr< const CBlock > &pblock, const CBlockIndex *pindex, const std::vector< CTransactionRef > &vtxConflicted)
 
void BlockDisconnected (const std::shared_ptr< const CBlock > &pblock, const CBlockIndex *pindexDisconnected)
 
void AddNonLockedTx (const CTransactionRef &tx, const CBlockIndex *pindexMined)
 
void RemoveNonLockedTx (const uint256 &txid, bool retryChildren)
 
void RemoveConflictedTx (const CTransaction &tx)
 
void TruncateRecoveredSigsForInputs (const CInstantSendLock &islock)
 
void NotifyChainLock (const CBlockIndex *pindexChainLock)
 
void UpdatedBlockTip (const CBlockIndex *pindexNew)
 
void HandleFullyConfirmedBlock (const CBlockIndex *pindex)
 
void RemoveMempoolConflictsForLock (const uint256 &hash, const CInstantSendLock &islock)
 
void ResolveBlockConflicts (const uint256 &islockHash, const CInstantSendLock &islock)
 
void RemoveChainLockConflictingLock (const uint256 &islockHash, const CInstantSendLock &islock)
 
void AskNodesForLockedTx (const uint256 &txid)
 
bool ProcessPendingRetryLockTxs ()
 
bool AlreadyHave (const CInv &inv)
 
bool GetInstantSendLockByHash (const uint256 &hash, CInstantSendLock &ret)
 
bool GetInstantSendLockHashByTxid (const uint256 &txid, uint256 &ret)
 
size_t GetInstantSendLockCount ()
 
void WorkThreadMain ()
 
- Public Member Functions inherited from llmq::CRecoveredSigsListener
virtual ~CRecoveredSigsListener ()
 

Private Attributes

CCriticalSection cs
 
CInstantSendDb db
 
std::thread workThread
 
CThreadInterrupt workInterrupt
 
std::unordered_set< uint256, StaticSaltedHasherinputRequestIds
 Request ids of inputs that we signed. More...
 
std::unordered_map< uint256, CInstantSendLock, StaticSaltedHashercreatingInstantSendLocks
 These are the islocks that are currently in the middle of being created. More...
 
std::unordered_map< uint256, CInstantSendLock *, StaticSaltedHashertxToCreatingInstantSendLocks
 
std::unordered_map< uint256, std::pair< NodeId, CInstantSendLock >, StaticSaltedHasherpendingInstantSendLocks
 
std::unordered_map< uint256, NonLockedTxInfo, StaticSaltedHashernonLockedTxs
 
std::unordered_map< COutPoint, uint256, SaltedOutpointHashernonLockedTxsByOutpoints
 
std::unordered_set< uint256, StaticSaltedHasherpendingRetryTxs
 

Detailed Description

Definition at line 75 of file quorums_instantsend.h.

Constructor & Destructor Documentation

◆ CInstantSendManager()

llmq::CInstantSendManager::CInstantSendManager ( CDBWrapper _llmqDb)
explicit

Definition at line 342 of file quorums_instantsend.cpp.

References CThreadInterrupt::reset(), and workInterrupt.

◆ ~CInstantSendManager()

llmq::CInstantSendManager::~CInstantSendManager ( )

Definition at line 348 of file quorums_instantsend.cpp.

Member Function Documentation

◆ AddNonLockedTx()

void llmq::CInstantSendManager::AddNonLockedTx ( const CTransactionRef tx,
const CBlockIndex pindexMined 
)

◆ AlreadyHave()

◆ AskNodesForLockedTx()

void llmq::CInstantSendManager::AskNodesForLockedTx ( const uint256 txid)

◆ BlockConnected()

void llmq::CInstantSendManager::BlockConnected ( const std::shared_ptr< const CBlock > &  pblock,
const CBlockIndex pindex,
const std::vector< CTransactionRef > &  vtxConflicted 
)

◆ BlockDisconnected()

void llmq::CInstantSendManager::BlockDisconnected ( const std::shared_ptr< const CBlock > &  pblock,
const CBlockIndex pindexDisconnected 
)

◆ CheckCanLock() [1/2]

bool llmq::CInstantSendManager::CheckCanLock ( const CTransaction tx,
bool  printDebug,
const Consensus::Params params 
)

Definition at line 481 of file quorums_instantsend.cpp.

References CTransaction::GetHash(), and CTransaction::vin.

Referenced by ProcessPendingRetryLockTxs(), and ProcessTx().

◆ CheckCanLock() [2/2]

◆ GetConflictingLock()

◆ GetInstantSendLockByHash()

bool llmq::CInstantSendManager::GetInstantSendLockByHash ( const uint256 hash,
llmq::CInstantSendLock ret 
)

◆ GetInstantSendLockCount()

size_t llmq::CInstantSendManager::GetInstantSendLockCount ( )

◆ GetInstantSendLockHashByTxid()

bool llmq::CInstantSendManager::GetInstantSendLockHashByTxid ( const uint256 txid,
uint256 ret 
)

◆ HandleFullyConfirmedBlock()

◆ HandleNewInputLockRecoveredSig()

void llmq::CInstantSendManager::HandleNewInputLockRecoveredSig ( const CRecoveredSig recoveredSig,
const uint256 txid 
)

◆ HandleNewInstantSendLockRecoveredSig()

◆ HandleNewRecoveredSig()

◆ InterruptWorkerThread()

void llmq::CInstantSendManager::InterruptWorkerThread ( )

Definition at line 378 of file quorums_instantsend.cpp.

References workInterrupt.

Referenced by llmq::InterruptLLMQSystem().

◆ IsConflicted()

bool llmq::CInstantSendManager::IsConflicted ( const CTransaction tx)

Definition at line 1474 of file quorums_instantsend.cpp.

References GetConflictingLock().

Referenced by ProcessPendingRetryLockTxs().

◆ IsLocked()

◆ NotifyChainLock()

void llmq::CInstantSendManager::NotifyChainLock ( const CBlockIndex pindexChainLock)

◆ PreVerifyInstantSendLock()

bool llmq::CInstantSendManager::PreVerifyInstantSendLock ( NodeId  nodeId,
const CInstantSendLock islock,
bool &  retBan 
)

◆ ProcessInstantSendLock()

◆ ProcessMessage()

void llmq::CInstantSendManager::ProcessMessage ( CNode pfrom,
const std::string &  strCommand,
CDataStream vRecv,
CConnman connman 
)

◆ ProcessMessageInstantSendLock()

◆ ProcessNewTransaction()

◆ ProcessPendingInstantSendLocks() [1/2]

bool llmq::CInstantSendManager::ProcessPendingInstantSendLocks ( )

◆ ProcessPendingInstantSendLocks() [2/2]

◆ ProcessPendingRetryLockTxs()

◆ ProcessTx()

◆ RemoveChainLockConflictingLock()

void llmq::CInstantSendManager::RemoveChainLockConflictingLock ( const uint256 islockHash,
const CInstantSendLock islock 
)

◆ RemoveConflictedTx()

◆ RemoveMempoolConflictsForLock()

◆ RemoveNonLockedTx()

void llmq::CInstantSendManager::RemoveNonLockedTx ( const uint256 txid,
bool  retryChildren 
)

◆ ResolveBlockConflicts()

◆ Start()

void llmq::CInstantSendManager::Start ( )

◆ Stop()

void llmq::CInstantSendManager::Stop ( )

◆ TransactionAddedToMempool()

void llmq::CInstantSendManager::TransactionAddedToMempool ( const CTransactionRef tx)

◆ TruncateRecoveredSigsForInputs()

◆ TrySignInstantSendLock()

◆ UpdatedBlockTip()

◆ UpdateWalletTransaction()

void llmq::CInstantSendManager::UpdateWalletTransaction ( const CTransactionRef tx,
const CInstantSendLock islock 
)

◆ WorkThreadMain()

void llmq::CInstantSendManager::WorkThreadMain ( )

Member Data Documentation

◆ creatingInstantSendLocks

std::unordered_map<uint256, CInstantSendLock, StaticSaltedHasher> llmq::CInstantSendManager::creatingInstantSendLocks
private

These are the islocks that are currently in the middle of being created.

Entries are created when we observed recovered signatures for all inputs of a TX. At the same time, we initiate signing of our sigshare for the islock. When the recovered sig for the islock later arrives, we can finish the islock and propagate it.

Definition at line 95 of file quorums_instantsend.h.

Referenced by HandleNewInstantSendLockRecoveredSig(), HandleNewRecoveredSig(), ProcessInstantSendLock(), and TrySignInstantSendLock().

◆ cs

◆ db

◆ inputRequestIds

std::unordered_set<uint256, StaticSaltedHasher> llmq::CInstantSendManager::inputRequestIds
private

Request ids of inputs that we signed.

Used to determine if a recovered signature belongs to an in-progress input lock.

Definition at line 88 of file quorums_instantsend.h.

Referenced by HandleNewRecoveredSig(), ProcessTx(), RemoveConflictedTx(), and TruncateRecoveredSigsForInputs().

◆ nonLockedTxs

std::unordered_map<uint256, NonLockedTxInfo, StaticSaltedHasher> llmq::CInstantSendManager::nonLockedTxs
private

◆ nonLockedTxsByOutpoints

std::unordered_map<COutPoint, uint256, SaltedOutpointHasher> llmq::CInstantSendManager::nonLockedTxsByOutpoints
private

Definition at line 110 of file quorums_instantsend.h.

Referenced by AddNonLockedTx(), RemoveNonLockedTx(), and ResolveBlockConflicts().

◆ pendingInstantSendLocks

std::unordered_map<uint256, std::pair<NodeId, CInstantSendLock>, StaticSaltedHasher> llmq::CInstantSendManager::pendingInstantSendLocks
private

◆ pendingRetryTxs

std::unordered_set<uint256, StaticSaltedHasher> llmq::CInstantSendManager::pendingRetryTxs
private

Definition at line 112 of file quorums_instantsend.h.

Referenced by ProcessPendingRetryLockTxs(), and RemoveNonLockedTx().

◆ txToCreatingInstantSendLocks

std::unordered_map<uint256, CInstantSendLock*, StaticSaltedHasher> llmq::CInstantSendManager::txToCreatingInstantSendLocks
private

◆ workInterrupt

CThreadInterrupt llmq::CInstantSendManager::workInterrupt
private

◆ workThread

std::thread llmq::CInstantSendManager::workThread
private

Definition at line 81 of file quorums_instantsend.h.

Referenced by Start(), and Stop().


The documentation for this class was generated from the following files:
Released under the MIT license