Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

#include <quorums_chainlocks.h>

+ Inheritance diagram for llmq::CChainLocksHandler:
+ Collaboration diagram for llmq::CChainLocksHandler:

Public Member Functions

 CChainLocksHandler ()
 
 ~CChainLocksHandler ()
 
void Start ()
 
void Stop ()
 
bool AlreadyHave (const CInv &inv)
 
bool GetChainLockByHash (const uint256 &hash, CChainLockSig &ret)
 
CChainLockSig GetBestChainLock ()
 
void ProcessMessage (CNode *pfrom, const std::string &strCommand, CDataStream &vRecv, CConnman &connman)
 
void ProcessNewChainLock (NodeId from, const CChainLockSig &clsig, const uint256 &hash)
 
void AcceptedBlockHeader (const CBlockIndex *pindexNew)
 
void UpdatedBlockTip (const CBlockIndex *pindexNew)
 
void TransactionAddedToMempool (const CTransactionRef &tx, int64_t nAcceptTime)
 
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 CheckActiveState ()
 
void TrySignChainTip ()
 
void EnforceBestChainLock ()
 
virtual void HandleNewRecoveredSig (const CRecoveredSig &recoveredSig)
 
bool HasChainLock (int nHeight, const uint256 &blockHash)
 
bool HasConflictingChainLock (int nHeight, const uint256 &blockHash)
 
bool IsTxSafeForMining (const uint256 &txid)
 
- Public Member Functions inherited from llmq::CRecoveredSigsListener
virtual ~CRecoveredSigsListener ()
 

Private Types

typedef std::unordered_map< uint256, std::shared_ptr< std::unordered_set< uint256, StaticSaltedHasher > > > BlockTxs
 

Private Member Functions

bool InternalHasChainLock (int nHeight, const uint256 &blockHash)
 
bool InternalHasConflictingChainLock (int nHeight, const uint256 &blockHash)
 
void DoInvalidateBlock (const CBlockIndex *pindex)
 
BlockTxs::mapped_type GetBlockTxs (const uint256 &blockHash)
 
void Cleanup ()
 

Private Attributes

CSchedulerscheduler
 
boost::thread * scheduler_thread
 
CCriticalSection cs
 
bool tryLockChainTipScheduled {false}
 
bool isSporkActive {false}
 
bool isEnforced {false}
 
uint256 bestChainLockHash
 
CChainLockSig bestChainLock
 
CChainLockSig bestChainLockWithKnownBlock
 
const CBlockIndexbestChainLockBlockIndex {nullptr}
 
const CBlockIndexlastNotifyChainLockBlockIndex {nullptr}
 
int32_t lastSignedHeight {-1}
 
uint256 lastSignedRequestId
 
uint256 lastSignedMsgHash
 
BlockTxs blockTxs
 
std::unordered_map< uint256, int64_t > txFirstSeenTime
 
std::map< uint256, int64_t > seenChainLocks
 
int64_t lastCleanupTime {0}
 

Static Private Attributes

static const int64_t CLEANUP_INTERVAL = 1000 * 30
 
static const int64_t CLEANUP_SEEN_TIMEOUT = 24 * 60 * 60 * 1000
 
static const int64_t WAIT_FOR_ISLOCK_TIMEOUT = 10 * 60
 

Detailed Description

Definition at line 47 of file quorums_chainlocks.h.

Member Typedef Documentation

◆ BlockTxs

typedef std::unordered_map<uint256, std::shared_ptr<std::unordered_set<uint256, StaticSaltedHasher> > > llmq::CChainLocksHandler::BlockTxs
private

Definition at line 75 of file quorums_chainlocks.h.

Constructor & Destructor Documentation

◆ CChainLocksHandler()

llmq::CChainLocksHandler::CChainLocksHandler ( )
explicit

Definition at line 36 of file quorums_chainlocks.cpp.

References scheduler, scheduler_thread, and CScheduler::serviceQueue().

◆ ~CChainLocksHandler()

llmq::CChainLocksHandler::~CChainLocksHandler ( )

Definition at line 43 of file quorums_chainlocks.cpp.

References scheduler, and scheduler_thread.

Member Function Documentation

◆ AcceptedBlockHeader()

◆ AlreadyHave()

bool llmq::CChainLocksHandler::AlreadyHave ( const CInv inv)

Definition at line 68 of file quorums_chainlocks.cpp.

References cs, CInv::hash, LOCK, and seenChainLocks.

Referenced by AlreadyHave().

◆ BlockConnected()

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

◆ BlockDisconnected()

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

◆ CheckActiveState()

◆ Cleanup()

◆ DoInvalidateBlock()

void llmq::CChainLocksHandler::DoInvalidateBlock ( const CBlockIndex pindex)
private

◆ EnforceBestChainLock()

◆ GetBestChainLock()

CChainLockSig llmq::CChainLocksHandler::GetBestChainLock ( )

Definition at line 87 of file quorums_chainlocks.cpp.

References bestChainLock, cs, and LOCK.

Referenced by getbestchainlock().

◆ GetBlockTxs()

CChainLocksHandler::BlockTxs::mapped_type llmq::CChainLocksHandler::GetBlockTxs ( const uint256 blockHash)
private

◆ GetChainLockByHash()

bool llmq::CChainLocksHandler::GetChainLockByHash ( const uint256 hash,
llmq::CChainLockSig ret 
)

Definition at line 74 of file quorums_chainlocks.cpp.

References bestChainLock, bestChainLockHash, cs, and LOCK.

◆ HandleNewRecoveredSig()

◆ HasChainLock()

◆ HasConflictingChainLock()

bool llmq::CChainLocksHandler::HasConflictingChainLock ( int  nHeight,
const uint256 blockHash 
)

Definition at line 638 of file quorums_chainlocks.cpp.

References cs, InternalHasConflictingChainLock(), and LOCK.

Referenced by CChainState::ConnectBlock().

◆ InternalHasChainLock()

bool llmq::CChainLocksHandler::InternalHasChainLock ( int  nHeight,
const uint256 blockHash 
)
private

◆ InternalHasConflictingChainLock()

bool llmq::CChainLocksHandler::InternalHasConflictingChainLock ( int  nHeight,
const uint256 blockHash 
)
private

◆ IsTxSafeForMining()

bool llmq::CChainLocksHandler::IsTxSafeForMining ( const uint256 txid)

◆ ProcessMessage()

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

◆ ProcessNewChainLock()

◆ Start()

◆ Stop()

void llmq::CChainLocksHandler::Stop ( )

◆ TransactionAddedToMempool()

void llmq::CChainLocksHandler::TransactionAddedToMempool ( const CTransactionRef tx,
int64_t  nAcceptTime 
)

Definition at line 364 of file quorums_chainlocks.cpp.

References cs, LOCK, and txFirstSeenTime.

Referenced by CDSNotificationInterface::TransactionAddedToMempool().

◆ TrySignChainTip()

◆ UpdatedBlockTip()

void llmq::CChainLocksHandler::UpdatedBlockTip ( const CBlockIndex pindexNew)

Member Data Documentation

◆ bestChainLock

◆ bestChainLockBlockIndex

const CBlockIndex* llmq::CChainLocksHandler::bestChainLockBlockIndex {nullptr}
private

◆ bestChainLockHash

uint256 llmq::CChainLocksHandler::bestChainLockHash
private

Definition at line 63 of file quorums_chainlocks.h.

Referenced by CheckActiveState(), GetChainLockByHash(), and ProcessNewChainLock().

◆ bestChainLockWithKnownBlock

CChainLockSig llmq::CChainLocksHandler::bestChainLockWithKnownBlock
private

◆ blockTxs

BlockTxs llmq::CChainLocksHandler::blockTxs
private

Definition at line 76 of file quorums_chainlocks.h.

Referenced by BlockConnected(), BlockDisconnected(), Cleanup(), and GetBlockTxs().

◆ CLEANUP_INTERVAL

const int64_t llmq::CChainLocksHandler::CLEANUP_INTERVAL = 1000 * 30
staticprivate

Definition at line 49 of file quorums_chainlocks.h.

Referenced by Cleanup().

◆ CLEANUP_SEEN_TIMEOUT

const int64_t llmq::CChainLocksHandler::CLEANUP_SEEN_TIMEOUT = 24 * 60 * 60 * 1000
staticprivate

Definition at line 50 of file quorums_chainlocks.h.

Referenced by Cleanup().

◆ cs

◆ isEnforced

bool llmq::CChainLocksHandler::isEnforced {false}
private

◆ isSporkActive

bool llmq::CChainLocksHandler::isSporkActive {false}
private

◆ lastCleanupTime

int64_t llmq::CChainLocksHandler::lastCleanupTime {0}
private

Definition at line 81 of file quorums_chainlocks.h.

Referenced by Cleanup().

◆ lastNotifyChainLockBlockIndex

const CBlockIndex* llmq::CChainLocksHandler::lastNotifyChainLockBlockIndex {nullptr}
private

Definition at line 68 of file quorums_chainlocks.h.

Referenced by CheckActiveState(), and EnforceBestChainLock().

◆ lastSignedHeight

int32_t llmq::CChainLocksHandler::lastSignedHeight {-1}
private

Definition at line 70 of file quorums_chainlocks.h.

Referenced by HandleNewRecoveredSig(), and TrySignChainTip().

◆ lastSignedMsgHash

uint256 llmq::CChainLocksHandler::lastSignedMsgHash
private

Definition at line 72 of file quorums_chainlocks.h.

Referenced by HandleNewRecoveredSig(), and TrySignChainTip().

◆ lastSignedRequestId

uint256 llmq::CChainLocksHandler::lastSignedRequestId
private

Definition at line 71 of file quorums_chainlocks.h.

Referenced by HandleNewRecoveredSig(), and TrySignChainTip().

◆ scheduler

CScheduler* llmq::CChainLocksHandler::scheduler
private

◆ scheduler_thread

boost::thread* llmq::CChainLocksHandler::scheduler_thread
private

Definition at line 57 of file quorums_chainlocks.h.

Referenced by CChainLocksHandler(), and ~CChainLocksHandler().

◆ seenChainLocks

std::map<uint256, int64_t> llmq::CChainLocksHandler::seenChainLocks
private

Definition at line 79 of file quorums_chainlocks.h.

Referenced by AlreadyHave(), Cleanup(), and ProcessNewChainLock().

◆ tryLockChainTipScheduled

bool llmq::CChainLocksHandler::tryLockChainTipScheduled {false}
private

Definition at line 59 of file quorums_chainlocks.h.

Referenced by UpdatedBlockTip().

◆ txFirstSeenTime

std::unordered_map<uint256, int64_t> llmq::CChainLocksHandler::txFirstSeenTime
private

◆ WAIT_FOR_ISLOCK_TIMEOUT

const int64_t llmq::CChainLocksHandler::WAIT_FOR_ISLOCK_TIMEOUT = 10 * 60
staticprivate

Definition at line 53 of file quorums_chainlocks.h.


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