Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
#include <deterministicmns.h>
Public Attributes | |
CCriticalSection | cs |
Private Member Functions | |
void | CleanupCache (int nHeight) |
Private Attributes | |
CEvoDB & | evoDb |
std::unordered_map< uint256, CDeterministicMNList, StaticSaltedHasher > | mnListsCache |
std::unordered_map< uint256, CDeterministicMNListDiff, StaticSaltedHasher > | mnListDiffsCache |
const CBlockIndex * | tipIndex {nullptr} |
Static Private Attributes | |
static const int | DISK_SNAPSHOT_PERIOD = 576 |
static const int | DISK_SNAPSHOTS = 3 |
static const int | LIST_DIFFS_CACHE_SIZE = DISK_SNAPSHOT_PERIOD * DISK_SNAPSHOTS |
Detailed Description
Definition at line 637 of file deterministicmns.h.
Constructor & Destructor Documentation
◆ CDeterministicMNManager()
|
explicit |
Definition at line 528 of file deterministicmns.cpp.
Member Function Documentation
◆ BuildNewListFromBlock()
bool CDeterministicMNManager::BuildNewListFromBlock | ( | const CBlock & | block, |
const CBlockIndex * | pindexPrev, | ||
CValidationState & | state, | ||
CDeterministicMNList & | mnListRet, | ||
bool | debugLogs | ||
) |
Definition at line 648 of file deterministicmns.cpp.
References CDeterministicMNList::AddMN(), CProRegTx::addr, CProUpServTx::addr, AssertLockHeld(), COIN, CProRegTx::collateralOutpoint, llmq::CFinalCommitmentTxPayload::commitment, cs, DecreasePoSePenalties(), CValidationState::DoS(), CDeterministicMNList::ForEachMN(), CDeterministicMNList::GetAllMNsCount(), CBlockIndex::GetAncestor(), CBlockIndex::GetBlockHash(), CChainParams::GetConsensus(), CTransaction::GetHash(), GetListForBlock(), CDeterministicMNList::GetMN(), CDeterministicMNList::GetMNByCollateral(), CDeterministicMNList::GetMNPayee(), CDeterministicMNList::GetTotalRegisteredCount(), GetTxPayload(), CDeterministicMNList::GetUniquePropertyMN(), GetUTXOCoin(), HandleQuorumCommitment(), COutPoint::hash, CDeterministicMNList::HasMN(), CDeterministicMNList::HasUniqueProperty(), base_blob< BITS >::IsNull(), llmq::CFinalCommitment::IsNull(), CProRegTx::keyIDOwner, CProUpRegTx::keyIDVoting, Consensus::Params::llmqs, llmq::CFinalCommitment::llmqType, LogPrintf, COutPoint::n, llmq::CFinalCommitmentTxPayload::nHeight, CBlockIndex::nHeight, Consensus::Params::nMasternodeMinimumConfirmations, CProRegTx::nOperatorReward, CProUpRevTx::nReason, CTransaction::nType, CTxOut::nValue, CTransaction::nVersion, Coin::out, Params(), CProUpServTx::proTxHash, CProUpRegTx::proTxHash, CProUpRevTx::proTxHash, CProRegTx::pubKeyOperator, CProUpRegTx::pubKeyOperator, llmq::CFinalCommitment::quorumHash, REJECT_DUPLICATE, REJECT_INVALID, CDeterministicMNList::RemoveMN(), CProUpServTx::scriptOperatorPayout, CProUpRegTx::scriptPayout, CDeterministicMNList::SetBlockHash(), CDeterministicMNList::SetHeight(), base_blob< BITS >::ToString(), CProRegTx::ToString(), CProUpServTx::ToString(), CProUpRegTx::ToString(), CProUpRevTx::ToString(), TRANSACTION_PROVIDER_REGISTER, TRANSACTION_PROVIDER_UPDATE_REGISTRAR, TRANSACTION_PROVIDER_UPDATE_REVOKE, TRANSACTION_PROVIDER_UPDATE_SERVICE, TRANSACTION_QUORUM_COMMITMENT, CDeterministicMNList::UpdateMN(), CTransaction::vin, and CBlock::vtx.
Referenced by ProcessBlock().
◆ CleanupCache()
|
private |
Definition at line 1031 of file deterministicmns.cpp.
References AssertLockHeld(), cs, CBlockIndex::GetBlockHash(), LIST_DIFFS_CACHE_SIZE, mnListDiffsCache, mnListsCache, Params(), CBlockIndex::pprev, and tipIndex.
Referenced by ProcessBlock().
◆ DecreasePoSePenalties()
void CDeterministicMNManager::DecreasePoSePenalties | ( | CDeterministicMNList & | mnList | ) |
Definition at line 902 of file deterministicmns.cpp.
References CDeterministicMNList::ForEachMN(), CDeterministicMNList::GetValidMNsCount(), and CDeterministicMNList::PoSeDecrease().
Referenced by BuildNewListFromBlock().
◆ GetListAtChainTip()
CDeterministicMNList CDeterministicMNManager::GetListAtChainTip | ( | ) |
Definition at line 989 of file deterministicmns.cpp.
References cs, GetListForBlock(), LOCK, and tipIndex.
◆ GetListForBlock()
CDeterministicMNList CDeterministicMNManager::GetListForBlock | ( | const CBlockIndex * | pindex | ) |
Definition at line 919 of file deterministicmns.cpp.
References CDeterministicMNList::ApplyDiff(), cs, DB_LIST_DIFF, DB_LIST_SNAPSHOT, evoDb, CBlockIndex::GetBlockHash(), CDeterministicMNList::GetBlockHash(), CChainParams::GetConsensus(), CDeterministicMNList::GetHeight(), Consensus::Params::llmqs, LOCK, mnListDiffsCache, mnListsCache, CBlockIndex::nHeight, CDeterministicMNListDiff::nHeight, Params(), CBlockIndex::pprev, CEvoDB::Read(), CDeterministicMNList::SetBlockHash(), CDeterministicMNList::SetHeight(), and tipIndex.
Referenced by BuildNewListFromBlock(), GetListAtChainTip(), ProcessBlock(), and UndoBlock().
◆ HandleQuorumCommitment()
void CDeterministicMNManager::HandleQuorumCommitment | ( | llmq::CFinalCommitment & | qc, |
const CBlockIndex * | pindexQuorum, | ||
CDeterministicMNList & | mnList, | ||
bool | debugLogs | ||
) |
Definition at line 882 of file deterministicmns.cpp.
References CDeterministicMNList::CalcPenalty(), llmq::CLLMQUtils::GetAllQuorumMembers(), CDeterministicMNList::HasMN(), llmq::CFinalCommitment::llmqType, CDeterministicMNList::PoSePunish(), and llmq::CFinalCommitment::validMembers.
Referenced by BuildNewListFromBlock().
◆ IsDIP3Enforced()
bool CDeterministicMNManager::IsDIP3Enforced | ( | int | nHeight = -1 | ) |
Definition at line 1020 of file deterministicmns.cpp.
References cs, Consensus::Params::DIP0003EnforcementHeight, CChainParams::GetConsensus(), LOCK, CBlockIndex::nHeight, Params(), and tipIndex.
◆ IsProTxWithCollateral()
bool CDeterministicMNManager::IsProTxWithCollateral | ( | const CTransactionRef & | tx, |
uint32_t | n | ||
) |
Definition at line 998 of file deterministicmns.cpp.
References COIN, CProRegTx::collateralOutpoint, GetTxPayload(), COutPoint::hash, base_blob< BITS >::IsNull(), COutPoint::n, and TRANSACTION_PROVIDER_REGISTER.
◆ ProcessBlock()
bool CDeterministicMNManager::ProcessBlock | ( | const CBlock & | block, |
const CBlockIndex * | pindex, | ||
CValidationState & | state, | ||
bool | fJustCheck | ||
) |
Definition at line 533 of file deterministicmns.cpp.
References AssertLockHeld(), CDeterministicMNList::BuildDiff(), BuildNewListFromBlock(), CleanupCache(), cs, cs_main, DB_LIST_DIFF, DB_LIST_SNAPSHOT, DISK_SNAPSHOT_PERIOD, CValidationState::DoS(), evoDb, CDeterministicMNList::GetAllMNsCount(), CBlockIndex::GetBlockHash(), CDeterministicMNList::GetBlockHash(), CChainParams::GetConsensus(), CBlockHeader::GetHash(), CDeterministicMNList::GetHeight(), GetListForBlock(), GetMainSignals(), CDeterministicMNListDiff::HasChanges(), LOCK, LogPrintf, mnListDiffsCache, mnListsCache, CBlockIndex::nHeight, CDeterministicMNListDiff::nHeight, CClientUIInterface::NotifyMasternodeListChanged, CMainSignals::NotifyMasternodeListChanged(), Params(), CBlockIndex::pprev, REJECT_INVALID, CDeterministicMNList::SetBlockHash(), CDeterministicMNList::SetHeight(), base_blob< BITS >::ToString(), uiInterface, and CEvoDB::Write().
◆ UndoBlock()
bool CDeterministicMNManager::UndoBlock | ( | const CBlock & | block, |
const CBlockIndex * | pindex | ||
) |
Definition at line 605 of file deterministicmns.cpp.
References CDeterministicMNList::BuildDiff(), cs, DB_LIST_DIFF, evoDb, CChainParams::GetConsensus(), CBlockHeader::GetHash(), GetListForBlock(), GetMainSignals(), CDeterministicMNListDiff::HasChanges(), LOCK, LogPrintf, mnListDiffsCache, mnListsCache, CBlockIndex::nHeight, CClientUIInterface::NotifyMasternodeListChanged, CMainSignals::NotifyMasternodeListChanged(), Params(), CBlockIndex::pprev, CEvoDB::Read(), and uiInterface.
◆ UpdatedBlockTip()
void CDeterministicMNManager::UpdatedBlockTip | ( | const CBlockIndex * | pindex | ) |
Definition at line 641 of file deterministicmns.cpp.
◆ UpgradeDBIfNeeded()
bool CDeterministicMNManager::UpgradeDBIfNeeded | ( | ) |
Definition at line 1130 of file deterministicmns.cpp.
References CEvoDB::BeginTransaction(), chainActive, CDBWrapper::CompactFull(), cs_main, DB_LIST_SNAPSHOT, Consensus::Params::DIP0003Height, DISK_SNAPSHOT_PERIOD, CDBWrapper::Erase(), evoDb, EVODB_BEST_BLOCK, CDBWrapper::Exists(), CBlockIndex::GetBlockHash(), GetBlockHash(), CChainParams::GetConsensus(), CEvoDB::GetRawDB(), CChain::Height(), LOCK, LogPrintf, Params(), CDeterministicMNList::SetHeight(), CChain::Tip(), UpgradeDiff(), CDBWrapper::WriteBatch(), and CEvoDB::WriteBestBlock().
◆ UpgradeDiff()
void CDeterministicMNManager::UpgradeDiff | ( | CDBBatch & | batch, |
const CBlockIndex * | pindexNext, | ||
const CDeterministicMNList & | curMNList, | ||
CDeterministicMNList & | newMNList | ||
) |
Definition at line 1078 of file deterministicmns.cpp.
References CDeterministicMNListDiff::addedMNs, CDeterministicMNList::ApplyDiff(), CLIENT_VERSION, DB_LIST_DIFF, evoDb, CBlockIndex::GetBlockHash(), CDeterministicMNList::GetMN(), CEvoDB::GetRawDB(), CDeterministicMNList::GetTotalRegisteredCount(), LogPrintf, CBlockIndex::nHeight, CDBWrapper::ReadDataStream(), CDeterministicMNListDiff::removedMns, SER_DISK, CDeterministicMNList::SetBlockHash(), strprintf, base_blob< BITS >::ToString(), CDeterministicMNListDiff::updatedMNs, CDeterministicMNList::UpdateMN(), and CDBBatch::Write().
Referenced by UpgradeDBIfNeeded().
Member Data Documentation
◆ cs
CCriticalSection CDeterministicMNManager::cs |
Definition at line 644 of file deterministicmns.h.
Referenced by BuildNewListFromBlock(), CleanupCache(), GetListAtChainTip(), GetListForBlock(), IsDIP3Enforced(), ProcessBlock(), UndoBlock(), and UpdatedBlockTip().
◆ DISK_SNAPSHOT_PERIOD
|
staticprivate |
Definition at line 639 of file deterministicmns.h.
Referenced by ProcessBlock(), and UpgradeDBIfNeeded().
◆ DISK_SNAPSHOTS
|
staticprivate |
Definition at line 640 of file deterministicmns.h.
◆ evoDb
|
private |
Definition at line 647 of file deterministicmns.h.
Referenced by GetListForBlock(), ProcessBlock(), UndoBlock(), UpgradeDBIfNeeded(), and UpgradeDiff().
◆ LIST_DIFFS_CACHE_SIZE
|
staticprivate |
Definition at line 641 of file deterministicmns.h.
Referenced by CleanupCache().
◆ mnListDiffsCache
|
private |
Definition at line 650 of file deterministicmns.h.
Referenced by CleanupCache(), GetListForBlock(), ProcessBlock(), and UndoBlock().
◆ mnListsCache
|
private |
Definition at line 649 of file deterministicmns.h.
Referenced by CleanupCache(), GetListForBlock(), ProcessBlock(), and UndoBlock().
◆ tipIndex
|
private |
Definition at line 651 of file deterministicmns.h.
Referenced by CleanupCache(), GetListAtChainTip(), GetListForBlock(), IsDIP3Enforced(), and UpdatedBlockTip().
The documentation for this class was generated from the following files:
- src/evo/deterministicmns.h
- src/evo/deterministicmns.cpp