PIVX Core  5.6.99
P2P Digital Currency
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
llmq::CChainLocksHandler Class Reference

#include <quorums_chainlocks.h>

Inheritance diagram for llmq::CChainLocksHandler:
[legend]
Collaboration diagram for llmq::CChainLocksHandler:
[legend]

Public Member Functions

 CChainLocksHandler (CScheduler *_scheduler)
 
 ~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 TrySignChainTip ()
 
void EnforceBestChainLock ()
 
virtual void HandleNewRecoveredSig (const CRecoveredSig &recoveredSig)
 
bool HasChainLock (int nHeight, const uint256 &blockHash)
 
bool HasConflictingChainLock (int nHeight, const uint256 &blockHash)
 
- Public Member Functions inherited from llmq::CRecoveredSigsListener
virtual ~CRecoveredSigsListener ()
 

Private Member Functions

bool InternalHasChainLock (int nHeight, const uint256 &blockHash)
 
bool InternalHasConflictingChainLock (int nHeight, const uint256 &blockHash)
 
void DoInvalidateBlock (const CBlockIndex *pindex, bool activateBestChain)
 
void Cleanup ()
 

Private Attributes

CSchedulerscheduler
 
RecursiveMutex cs
 
bool tryLockChainTipScheduled {false}
 
uint256 bestChainLockHash
 
CChainLockSig bestChainLock
 
CChainLockSig bestChainLockWithKnownBlock
 
const CBlockIndexbestChainLockBlockIndex {nullptr}
 
int32_t lastSignedHeight {-1}
 
uint256 lastSignedRequestId
 
uint256 lastSignedMsgHash
 
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
 

Detailed Description

Definition at line 42 of file quorums_chainlocks.h.

Constructor & Destructor Documentation

◆ CChainLocksHandler()

llmq::CChainLocksHandler::CChainLocksHandler ( CScheduler _scheduler)
explicit

Definition at line 36 of file quorums_chainlocks.cpp.

◆ ~CChainLocksHandler()

llmq::CChainLocksHandler::~CChainLocksHandler ( )

Definition at line 41 of file quorums_chainlocks.cpp.

Member Function Documentation

◆ AcceptedBlockHeader()

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

Definition at line 177 of file quorums_chainlocks.cpp.

Here is the call graph for this function:

◆ AlreadyHave()

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

Definition at line 61 of file quorums_chainlocks.cpp.

◆ Cleanup()

void llmq::CChainLocksHandler::Cleanup ( )
private

Definition at line 461 of file quorums_chainlocks.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoInvalidateBlock()

void llmq::CChainLocksHandler::DoInvalidateBlock ( const CBlockIndex pindex,
bool  activateBestChain 
)
private

Definition at line 374 of file quorums_chainlocks.cpp.

Here is the call graph for this function:

◆ EnforceBestChainLock()

void llmq::CChainLocksHandler::EnforceBestChainLock ( )

Definition at line 289 of file quorums_chainlocks.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBestChainLock()

CChainLockSig llmq::CChainLocksHandler::GetBestChainLock ( )

Definition at line 80 of file quorums_chainlocks.cpp.

◆ GetChainLockByHash()

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

Definition at line 67 of file quorums_chainlocks.cpp.

◆ HandleNewRecoveredSig()

void llmq::CChainLocksHandler::HandleNewRecoveredSig ( const CRecoveredSig recoveredSig)
virtual

Implements llmq::CRecoveredSigsListener.

Definition at line 347 of file quorums_chainlocks.cpp.

Here is the call graph for this function:

◆ HasChainLock()

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

Definition at line 400 of file quorums_chainlocks.cpp.

Here is the call graph for this function:

◆ HasConflictingChainLock()

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

Definition at line 430 of file quorums_chainlocks.cpp.

Here is the call graph for this function:

◆ InternalHasChainLock()

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

Definition at line 410 of file quorums_chainlocks.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InternalHasConflictingChainLock()

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

Definition at line 440 of file quorums_chainlocks.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProcessMessage()

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

Definition at line 86 of file quorums_chainlocks.cpp.

Here is the call graph for this function:

◆ ProcessNewChainLock()

void llmq::CChainLocksHandler::ProcessNewChainLock ( NodeId  from,
const CChainLockSig clsig,
const uint256 hash 
)

Definition at line 102 of file quorums_chainlocks.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Start()

void llmq::CChainLocksHandler::Start ( )

Definition at line 45 of file quorums_chainlocks.cpp.

Here is the call graph for this function:

◆ Stop()

void llmq::CChainLocksHandler::Stop ( )

Definition at line 56 of file quorums_chainlocks.cpp.

◆ TrySignChainTip()

void llmq::CChainLocksHandler::TrySignChainTip ( )

Definition at line 218 of file quorums_chainlocks.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdatedBlockTip()

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

Definition at line 199 of file quorums_chainlocks.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ bestChainLock

CChainLockSig llmq::CChainLocksHandler::bestChainLock
private

Definition at line 53 of file quorums_chainlocks.h.

◆ bestChainLockBlockIndex

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

Definition at line 56 of file quorums_chainlocks.h.

◆ bestChainLockHash

uint256 llmq::CChainLocksHandler::bestChainLockHash
private

Definition at line 52 of file quorums_chainlocks.h.

◆ bestChainLockWithKnownBlock

CChainLockSig llmq::CChainLocksHandler::bestChainLockWithKnownBlock
private

Definition at line 55 of file quorums_chainlocks.h.

◆ CLEANUP_INTERVAL

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

Definition at line 44 of file quorums_chainlocks.h.

◆ CLEANUP_SEEN_TIMEOUT

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

Definition at line 45 of file quorums_chainlocks.h.

◆ cs

RecursiveMutex llmq::CChainLocksHandler::cs
private

Definition at line 49 of file quorums_chainlocks.h.

◆ lastCleanupTime

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

Definition at line 64 of file quorums_chainlocks.h.

◆ lastSignedHeight

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

Definition at line 58 of file quorums_chainlocks.h.

◆ lastSignedMsgHash

uint256 llmq::CChainLocksHandler::lastSignedMsgHash
private

Definition at line 60 of file quorums_chainlocks.h.

◆ lastSignedRequestId

uint256 llmq::CChainLocksHandler::lastSignedRequestId
private

Definition at line 59 of file quorums_chainlocks.h.

◆ scheduler

CScheduler* llmq::CChainLocksHandler::scheduler
private

Definition at line 48 of file quorums_chainlocks.h.

◆ seenChainLocks

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

Definition at line 62 of file quorums_chainlocks.h.

◆ tryLockChainTipScheduled

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

Definition at line 50 of file quorums_chainlocks.h.


The documentation for this class was generated from the following files: