Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
#include <quorums_blockprocessor.h>
Private Member Functions | |
bool | GetCommitmentsFromBlock (const CBlock &block, const CBlockIndex *pindex, std::map< Consensus::LLMQType, CFinalCommitment > &ret, CValidationState &state) |
bool | ProcessCommitment (int nHeight, const uint256 &blockHash, const CFinalCommitment &qc, CValidationState &state) |
bool | IsMiningPhase (Consensus::LLMQType llmqType, int nHeight) |
bool | IsCommitmentRequired (Consensus::LLMQType llmqType, int nHeight) |
uint256 | GetQuorumBlockHash (Consensus::LLMQType llmqType, int nHeight) |
Private Attributes | |
CEvoDB & | evoDb |
CCriticalSection | minableCommitmentsCs |
std::map< std::pair< Consensus::LLMQType, uint256 >, uint256 > | minableCommitmentsByQuorum |
std::map< uint256, CFinalCommitment > | minableCommitments |
std::unordered_map< std::pair< Consensus::LLMQType, uint256 >, bool, StaticSaltedHasher > | hasMinedCommitmentCache |
Detailed Description
Definition at line 25 of file quorums_blockprocessor.h.
Constructor & Destructor Documentation
◆ CQuorumBlockProcessor()
|
inlineexplicit |
Definition at line 38 of file quorums_blockprocessor.h.
Member Function Documentation
◆ AddMinableCommitment()
void llmq::CQuorumBlockProcessor::AddMinableCommitment | ( | const CFinalCommitment & | fqc | ) |
Definition at line 487 of file quorums_blockprocessor.cpp.
References llmq::CFinalCommitment::CountSigners(), DMN_PROTO_VERSION, g_connman, llmq::CFinalCommitment::llmqType, LOCK, minableCommitments, minableCommitmentsByQuorum, minableCommitmentsCs, MSG_QUORUM_FINAL_COMMITMENT, llmq::CFinalCommitment::quorumHash, and SerializeHash().
Referenced by llmq::CDKGSessionHandler::HandleDKGRound(), ProcessMessage(), and UndoBlock().
◆ GetCommitmentsFromBlock()
|
private |
Definition at line 317 of file quorums_blockprocessor.cpp.
References AssertLockHeld(), llmq::CFinalCommitmentTxPayload::commitment, cs_main, CValidationState::DoS(), CChainParams::GetConsensus(), GetTxPayload(), llmq::CFinalCommitment::llmqType, CBlockIndex::nHeight, Params(), REJECT_INVALID, TRANSACTION_QUORUM_COMMITMENT, and CBlock::vtx.
Referenced by ProcessBlock(), UndoBlock(), and UpgradeDB().
◆ GetMinableCommitment()
bool llmq::CQuorumBlockProcessor::GetMinableCommitment | ( | Consensus::LLMQType | llmqType, |
int | nHeight, | ||
CFinalCommitment & | ret | ||
) |
Definition at line 532 of file quorums_blockprocessor.cpp.
References AssertLockHeld(), cs_main, GetQuorumBlockHash(), IsCommitmentRequired(), base_blob< BITS >::IsNull(), LOCK, minableCommitments, minableCommitmentsByQuorum, minableCommitmentsCs, and Params().
Referenced by GetMinableCommitmentTx().
◆ GetMinableCommitmentByHash()
bool llmq::CQuorumBlockProcessor::GetMinableCommitmentByHash | ( | const uint256 & | commitmentHash, |
llmq::CFinalCommitment & | ret | ||
) |
Definition at line 519 of file quorums_blockprocessor.cpp.
References LOCK, minableCommitments, and minableCommitmentsCs.
◆ GetMinableCommitmentTx()
bool llmq::CQuorumBlockProcessor::GetMinableCommitmentTx | ( | Consensus::LLMQType | llmqType, |
int | nHeight, | ||
CTransactionRef & | ret | ||
) |
Definition at line 561 of file quorums_blockprocessor.cpp.
References AssertLockHeld(), llmq::CFinalCommitmentTxPayload::commitment, cs_main, GetMinableCommitment(), MakeTransactionRef(), llmq::CFinalCommitmentTxPayload::nHeight, CMutableTransaction::nType, CMutableTransaction::nVersion, SetTxPayload(), and TRANSACTION_QUORUM_COMMITMENT.
◆ GetMinedAndActiveCommitmentsUntilBlock()
std::map< Consensus::LLMQType, std::vector< const CBlockIndex * > > llmq::CQuorumBlockProcessor::GetMinedAndActiveCommitmentsUntilBlock | ( | const CBlockIndex * | pindex | ) |
Definition at line 465 of file quorums_blockprocessor.cpp.
References GetMinedCommitmentsUntilBlock(), and Params().
Referenced by CSimplifiedMNListDiff::BuildQuorumsDiff(), and CalcCbTxMerkleRootQuorums().
◆ GetMinedCommitment()
bool llmq::CQuorumBlockProcessor::GetMinedCommitment | ( | Consensus::LLMQType | llmqType, |
const uint256 & | quorumHash, | ||
CFinalCommitment & | ret, | ||
uint256 & | retMinedBlockHash | ||
) |
Definition at line 408 of file quorums_blockprocessor.cpp.
References llmq::DB_MINED_COMMITMENT, evoDb, and CEvoDB::Read().
Referenced by CalcCbTxMerkleRootQuorums(), and llmq::CQuorumManager::GetQuorum().
◆ GetMinedCommitmentsUntilBlock()
std::vector< const CBlockIndex * > llmq::CQuorumBlockProcessor::GetMinedCommitmentsUntilBlock | ( | Consensus::LLMQType | llmqType, |
const CBlockIndex * | pindex, | ||
size_t | maxCount | ||
) |
Definition at line 421 of file quorums_blockprocessor.cpp.
References be32toh(), llmq::BuildInversedHeightKey(), CEvoDB::cs, llmq::DB_MINED_COMMITMENT_BY_INVERSED_HEIGHT, evoDb, CBlockIndex::GetAncestor(), CEvoDB::GetCurTransaction(), LOCK, CDBTransaction< Parent, CommitTarget >::NewIteratorUniquePtr(), and CBlockIndex::nHeight.
Referenced by GetMinedAndActiveCommitmentsUntilBlock(), and llmq::CQuorumManager::ScanQuorums().
◆ GetQuorumBlockHash()
|
private |
Definition at line 375 of file quorums_blockprocessor.cpp.
References AssertLockHeld(), cs_main, GetBlockHash(), CChainParams::GetConsensus(), Consensus::Params::llmqs, and Params().
Referenced by GetMinableCommitment(), IsCommitmentRequired(), and ProcessCommitment().
◆ HasMinableCommitment()
bool llmq::CQuorumBlockProcessor::HasMinableCommitment | ( | const uint256 & | hash | ) |
Definition at line 481 of file quorums_blockprocessor.cpp.
References LOCK, minableCommitments, and minableCommitmentsCs.
Referenced by AlreadyHave().
◆ HasMinedCommitment()
bool llmq::CQuorumBlockProcessor::HasMinedCommitment | ( | Consensus::LLMQType | llmqType, |
const uint256 & | quorumHash | ||
) |
Definition at line 389 of file quorums_blockprocessor.cpp.
References llmq::DB_MINED_COMMITMENT, evoDb, CEvoDB::Exists(), hasMinedCommitmentCache, LOCK, and minableCommitmentsCs.
Referenced by llmq::CQuorumManager::HasQuorum(), IsCommitmentRequired(), and ProcessCommitment().
◆ IsCommitmentRequired()
|
private |
Definition at line 360 of file quorums_blockprocessor.cpp.
References GetQuorumBlockHash(), HasMinedCommitment(), IsMiningPhase(), and base_blob< BITS >::IsNull().
Referenced by GetMinableCommitment(), and ProcessBlock().
◆ IsMiningPhase()
|
private |
Definition at line 350 of file quorums_blockprocessor.cpp.
References CChainParams::GetConsensus(), Consensus::Params::llmqs, and Params().
Referenced by IsCommitmentRequired(), and ProcessCommitment().
◆ ProcessBlock()
bool llmq::CQuorumBlockProcessor::ProcessBlock | ( | const CBlock & | block, |
const CBlockIndex * | pindex, | ||
CValidationState & | state | ||
) |
Definition at line 119 of file quorums_blockprocessor.cpp.
References AssertLockHeld(), chainActive, cs_main, llmq::DB_BEST_BLOCK_UPGRADE, Consensus::Params::DIP0003Height, CValidationState::DoS(), evoDb, GetCommitmentsFromBlock(), CChainParams::GetConsensus(), CBlockHeader::GetHash(), IsCommitmentRequired(), Consensus::Params::llmqs, CBlockIndex::nHeight, Params(), ProcessCommitment(), REJECT_INVALID, CChain::Tip(), and CEvoDB::Write().
◆ ProcessCommitment()
|
private |
Definition at line 183 of file quorums_blockprocessor.cpp.
References llmq::BuildInversedHeightKey(), chainActive, llmq::CFinalCommitment::CountSigners(), llmq::CFinalCommitment::CountValidMembers(), llmq::DB_MINED_COMMITMENT, CValidationState::DoS(), evoDb, llmq::CLLMQUtils::GetAllQuorumMembers(), CChainParams::GetConsensus(), GetQuorumBlockHash(), HasMinedCommitment(), hasMinedCommitmentCache, IsMiningPhase(), base_blob< BITS >::IsNull(), llmq::CFinalCommitment::IsNull(), BCLog::LLMQ, Consensus::Params::llmqs, llmq::CFinalCommitment::llmqType, LOCK, LogPrint, mapBlockIndex, minableCommitmentsCs, Params(), llmq::CFinalCommitment::quorumHash, llmq::CFinalCommitment::quorumPublicKey, REJECT_INVALID, CChain::Tip(), base_blob< BITS >::ToString(), CBLSWrapper< ImplType, _SerSize, C >::ToString(), llmq::CFinalCommitment::Verify(), llmq::CFinalCommitment::VerifyNull(), and CEvoDB::Write().
Referenced by ProcessBlock().
◆ ProcessMessage()
void llmq::CQuorumBlockProcessor::ProcessMessage | ( | CNode * | pfrom, |
const std::string & | strCommand, | ||
CDataStream & | vRecv, | ||
CConnman & | connman | ||
) |
Definition at line 30 of file quorums_blockprocessor.cpp.
References AddMinableCommitment(), chainActive, cs_main, EraseObjectRequest(), llmq::CLLMQUtils::GetAllQuorumMembers(), CBlockIndex::GetAncestor(), CChainParams::GetConsensus(), CNode::GetId(), BCLog::LLMQ, Consensus::Params::llmqs, LOCK, LogPrint, mapBlockIndex, minableCommitments, minableCommitmentsByQuorum, minableCommitmentsCs, Misbehaving(), MSG_QUORUM_FINAL_COMMITMENT, CBlockIndex::nHeight, Params(), NetMsgType::QFCOMMITMENT, SerializeHash(), and CChain::Tip().
Referenced by ProcessMessage().
◆ UndoBlock()
bool llmq::CQuorumBlockProcessor::UndoBlock | ( | const CBlock & | block, |
const CBlockIndex * | pindex | ||
) |
Definition at line 240 of file quorums_blockprocessor.cpp.
References AddMinableCommitment(), AssertLockHeld(), llmq::BuildInversedHeightKey(), cs_main, llmq::DB_BEST_BLOCK_UPGRADE, llmq::DB_MINED_COMMITMENT, CEvoDB::Erase(), evoDb, CBlockIndex::GetBlockHash(), GetCommitmentsFromBlock(), hasMinedCommitmentCache, LOCK, minableCommitmentsCs, CBlockIndex::nHeight, CBlockIndex::pprev, and CEvoDB::Write().
◆ UpgradeDB()
void llmq::CQuorumBlockProcessor::UpgradeDB | ( | ) |
Definition at line 273 of file quorums_blockprocessor.cpp.
References BLOCK_HAVE_DATA, llmq::BuildInversedHeightKey(), chainActive, cs_main, llmq::DB_BEST_BLOCK_UPGRADE, llmq::DB_MINED_COMMITMENT, Consensus::Params::DIP0003EnforcementHeight, evoDb, fPruneMode, CBlockIndex::GetBlockHash(), GetCommitmentsFromBlock(), CChainParams::GetConsensus(), CEvoDB::GetRawDB(), CChain::Height(), LOCK, LogPrintf, mapBlockIndex, CChain::Next(), Params(), CDBWrapper::Read(), ReadBlockFromDisk(), CChain::Tip(), and CDBWrapper::Write().
Referenced by llmq::StartLLMQSystem().
Member Data Documentation
◆ evoDb
|
private |
Definition at line 28 of file quorums_blockprocessor.h.
Referenced by GetMinedCommitment(), GetMinedCommitmentsUntilBlock(), HasMinedCommitment(), ProcessBlock(), ProcessCommitment(), UndoBlock(), and UpgradeDB().
◆ hasMinedCommitmentCache
|
private |
Definition at line 35 of file quorums_blockprocessor.h.
Referenced by HasMinedCommitment(), ProcessCommitment(), and UndoBlock().
◆ minableCommitments
|
private |
Definition at line 33 of file quorums_blockprocessor.h.
Referenced by AddMinableCommitment(), GetMinableCommitment(), GetMinableCommitmentByHash(), HasMinableCommitment(), and ProcessMessage().
◆ minableCommitmentsByQuorum
|
private |
Definition at line 32 of file quorums_blockprocessor.h.
Referenced by AddMinableCommitment(), GetMinableCommitment(), and ProcessMessage().
◆ minableCommitmentsCs
|
private |
Definition at line 31 of file quorums_blockprocessor.h.
Referenced by AddMinableCommitment(), GetMinableCommitment(), GetMinableCommitmentByHash(), HasMinableCommitment(), HasMinedCommitment(), ProcessCommitment(), ProcessMessage(), and UndoBlock().
The documentation for this class was generated from the following files:
- src/llmq/quorums_blockprocessor.h
- src/llmq/quorums_blockprocessor.cpp