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

#include <quorums_blockprocessor.h>

Collaboration diagram for llmq::CQuorumBlockProcessor:
[legend]

Public Member Functions

 CQuorumBlockProcessor (CEvoDB &_evoDb)
 
void ProcessMessage (CNode *pfrom, CDataStream &vRecv, int &retMisbehavingScore)
 
bool ProcessBlock (const CBlock &block, const CBlockIndex *pindex, CValidationState &state, bool fJustCheck)
 
bool UndoBlock (const CBlock &block, const CBlockIndex *pindex)
 
void AddAndRelayMinableCommitment (const CFinalCommitment &fqc, uint256 *cached_fqc_hash=nullptr)
 
bool HasMinableCommitment (const uint256 &hash)
 
bool HasBetterMinableCommitment (const CFinalCommitment &qc)
 
bool GetMinableCommitmentByHash (const uint256 &commitmentHash, CFinalCommitment &ret)
 
bool GetMinableCommitment (Consensus::LLMQType llmqType, int nHeight, CFinalCommitment &ret)
 
bool GetMinableCommitmentTx (Consensus::LLMQType llmqType, int nHeight, CTransactionRef &ret)
 
bool HasMinedCommitment (Consensus::LLMQType llmqType, const uint256 &quorumHash)
 
bool GetMinedCommitment (Consensus::LLMQType llmqType, const uint256 &quorumHash, CFinalCommitment &ret, uint256 &retMinedBlockHash)
 
std::vector< const CBlockIndex * > GetMinedCommitmentsUntilBlock (Consensus::LLMQType llmqType, const CBlockIndex *pindex, size_t maxCount)
 
std::map< Consensus::LLMQType, std::vector< const CBlockIndex * > > GetMinedAndActiveCommitmentsUntilBlock (const CBlockIndex *pindex)
 

Private Member Functions

std::map< Consensus::LLMQType, unordered_lru_cache< uint256, bool, StaticSaltedHasher > > mapHasMinedCommitmentCache GUARDED_BY (minableCommitmentsCs)
 
bool ProcessCommitment (int nHeight, const uint256 &blockHash, const CFinalCommitment &qc, CValidationState &state, bool fJustCheck)
 
bool IsCommitmentRequired (Consensus::LLMQType llmqType, int nHeight)
 

Static Private Member Functions

static bool GetCommitmentsFromBlock (const CBlock &block, const CBlockIndex *pindex, std::map< Consensus::LLMQType, CFinalCommitment > &ret, CValidationState &state)
 
static bool IsMiningPhase (Consensus::LLMQType llmqType, int nHeight)
 
static uint256 GetQuorumBlockHash (Consensus::LLMQType llmqType, int nHeight)
 

Private Attributes

CEvoDBevoDb
 
RecursiveMutex minableCommitmentsCs
 
std::map< std::pair< uint8_t, uint256 >, uint256minableCommitmentsByQuorum
 
std::map< uint256, CFinalCommitmentminableCommitments
 

Detailed Description

Definition at line 30 of file quorums_blockprocessor.h.

Constructor & Destructor Documentation

◆ CQuorumBlockProcessor()

llmq::CQuorumBlockProcessor::CQuorumBlockProcessor ( CEvoDB _evoDb)
explicit

Definition at line 28 of file quorums_blockprocessor.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ AddAndRelayMinableCommitment()

void llmq::CQuorumBlockProcessor::AddAndRelayMinableCommitment ( const CFinalCommitment fqc,
uint256 cached_fqc_hash = nullptr 
)

Definition at line 388 of file quorums_blockprocessor.cpp.

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

◆ GetCommitmentsFromBlock()

bool llmq::CQuorumBlockProcessor::GetCommitmentsFromBlock ( const CBlock block,
const CBlockIndex pindex,
std::map< Consensus::LLMQType, CFinalCommitment > &  ret,
CValidationState state 
)
staticprivate

Definition at line 221 of file quorums_blockprocessor.cpp.

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

◆ GetMinableCommitment()

bool llmq::CQuorumBlockProcessor::GetMinableCommitment ( Consensus::LLMQType  llmqType,
int  nHeight,
CFinalCommitment ret 
)

Definition at line 431 of file quorums_blockprocessor.cpp.

Here is the call graph for this function:

◆ GetMinableCommitmentByHash()

bool llmq::CQuorumBlockProcessor::GetMinableCommitmentByHash ( const uint256 commitmentHash,
llmq::CFinalCommitment ret 
)

Definition at line 418 of file quorums_blockprocessor.cpp.

◆ GetMinableCommitmentTx()

bool llmq::CQuorumBlockProcessor::GetMinableCommitmentTx ( Consensus::LLMQType  llmqType,
int  nHeight,
CTransactionRef ret 
)

Definition at line 464 of file quorums_blockprocessor.cpp.

Here is the call graph for this function:

◆ GetMinedAndActiveCommitmentsUntilBlock()

std::map< Consensus::LLMQType, std::vector< const CBlockIndex * > > llmq::CQuorumBlockProcessor::GetMinedAndActiveCommitmentsUntilBlock ( const CBlockIndex pindex)

Definition at line 355 of file quorums_blockprocessor.cpp.

Here is the call graph for this function:

◆ GetMinedCommitment()

bool llmq::CQuorumBlockProcessor::GetMinedCommitment ( Consensus::LLMQType  llmqType,
const uint256 quorumHash,
CFinalCommitment ret,
uint256 retMinedBlockHash 
)

Definition at line 298 of file quorums_blockprocessor.cpp.

Here is the call graph for this function:

◆ GetMinedCommitmentsUntilBlock()

std::vector< const CBlockIndex * > llmq::CQuorumBlockProcessor::GetMinedCommitmentsUntilBlock ( Consensus::LLMQType  llmqType,
const CBlockIndex pindex,
size_t  maxCount 
)

Definition at line 311 of file quorums_blockprocessor.cpp.

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

◆ GetQuorumBlockHash()

uint256 llmq::CQuorumBlockProcessor::GetQuorumBlockHash ( Consensus::LLMQType  llmqType,
int  nHeight 
)
staticprivate

Definition at line 268 of file quorums_blockprocessor.cpp.

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

◆ GUARDED_BY()

std::map<Consensus::LLMQType, unordered_lru_cache<uint256, bool, StaticSaltedHasher> > mapHasMinedCommitmentCache llmq::CQuorumBlockProcessor::GUARDED_BY ( minableCommitmentsCs  )
mutableprivate

◆ HasBetterMinableCommitment()

bool llmq::CQuorumBlockProcessor::HasBetterMinableCommitment ( const CFinalCommitment qc)

Definition at line 377 of file quorums_blockprocessor.cpp.

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

◆ HasMinableCommitment()

bool llmq::CQuorumBlockProcessor::HasMinableCommitment ( const uint256 hash)

Definition at line 371 of file quorums_blockprocessor.cpp.

◆ HasMinedCommitment()

bool llmq::CQuorumBlockProcessor::HasMinedCommitment ( Consensus::LLMQType  llmqType,
const uint256 quorumHash 
)

Definition at line 280 of file quorums_blockprocessor.cpp.

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

◆ IsCommitmentRequired()

bool llmq::CQuorumBlockProcessor::IsCommitmentRequired ( Consensus::LLMQType  llmqType,
int  nHeight 
)
private

Definition at line 253 of file quorums_blockprocessor.cpp.

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

◆ IsMiningPhase()

bool llmq::CQuorumBlockProcessor::IsMiningPhase ( Consensus::LLMQType  llmqType,
int  nHeight 
)
staticprivate

Definition at line 246 of file quorums_blockprocessor.cpp.

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

◆ ProcessBlock()

bool llmq::CQuorumBlockProcessor::ProcessBlock ( const CBlock block,
const CBlockIndex pindex,
CValidationState state,
bool  fJustCheck 
)

Definition at line 90 of file quorums_blockprocessor.cpp.

Here is the call graph for this function:

◆ ProcessCommitment()

bool llmq::CQuorumBlockProcessor::ProcessCommitment ( int  nHeight,
const uint256 blockHash,
const CFinalCommitment qc,
CValidationState state,
bool  fJustCheck 
)
private

Definition at line 152 of file quorums_blockprocessor.cpp.

Here is the call graph for this function:

◆ ProcessMessage()

void llmq::CQuorumBlockProcessor::ProcessMessage ( CNode pfrom,
CDataStream vRecv,
int &  retMisbehavingScore 
)

Definition at line 46 of file quorums_blockprocessor.cpp.

Here is the call graph for this function:

◆ UndoBlock()

bool llmq::CQuorumBlockProcessor::UndoBlock ( const CBlock block,
const CBlockIndex pindex 
)

Definition at line 191 of file quorums_blockprocessor.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ evoDb

CEvoDB& llmq::CQuorumBlockProcessor::evoDb
private

Definition at line 33 of file quorums_blockprocessor.h.

◆ minableCommitments

std::map<uint256, CFinalCommitment> llmq::CQuorumBlockProcessor::minableCommitments
private

Definition at line 40 of file quorums_blockprocessor.h.

◆ minableCommitmentsByQuorum

std::map<std::pair<uint8_t, uint256>, uint256> llmq::CQuorumBlockProcessor::minableCommitmentsByQuorum
private

Definition at line 38 of file quorums_blockprocessor.h.

◆ minableCommitmentsCs

RecursiveMutex llmq::CQuorumBlockProcessor::minableCommitmentsCs
mutableprivate
Todo:
cleanup

Definition at line 36 of file quorums_blockprocessor.h.


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