Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

#include <deterministicmns.h>

+ Collaboration diagram for CDeterministicMNManager:

Public Member Functions

 CDeterministicMNManager (CEvoDB &_evoDb)
 
bool ProcessBlock (const CBlock &block, const CBlockIndex *pindex, CValidationState &state, bool fJustCheck)
 
bool UndoBlock (const CBlock &block, const CBlockIndex *pindex)
 
void UpdatedBlockTip (const CBlockIndex *pindex)
 
bool BuildNewListFromBlock (const CBlock &block, const CBlockIndex *pindexPrev, CValidationState &state, CDeterministicMNList &mnListRet, bool debugLogs)
 
void HandleQuorumCommitment (llmq::CFinalCommitment &qc, const CBlockIndex *pindexQuorum, CDeterministicMNList &mnList, bool debugLogs)
 
void DecreasePoSePenalties (CDeterministicMNList &mnList)
 
CDeterministicMNList GetListForBlock (const CBlockIndex *pindex)
 
CDeterministicMNList GetListAtChainTip ()
 
bool IsProTxWithCollateral (const CTransactionRef &tx, uint32_t n)
 
bool IsDIP3Enforced (int nHeight=-1)
 
void UpgradeDiff (CDBBatch &batch, const CBlockIndex *pindexNext, const CDeterministicMNList &curMNList, CDeterministicMNList &newMNList)
 
bool UpgradeDBIfNeeded ()
 

Public Attributes

CCriticalSection cs
 

Private Member Functions

void CleanupCache (int nHeight)
 

Private Attributes

CEvoDBevoDb
 
std::unordered_map< uint256, CDeterministicMNList, StaticSaltedHashermnListsCache
 
std::unordered_map< uint256, CDeterministicMNListDiff, StaticSaltedHashermnListDiffsCache
 
const CBlockIndextipIndex {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()

CDeterministicMNManager::CDeterministicMNManager ( CEvoDB _evoDb)
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()

void CDeterministicMNManager::CleanupCache ( int  nHeight)
private

◆ DecreasePoSePenalties()

void CDeterministicMNManager::DecreasePoSePenalties ( CDeterministicMNList mnList)

◆ GetListAtChainTip()

CDeterministicMNList CDeterministicMNManager::GetListAtChainTip ( )

Definition at line 989 of file deterministicmns.cpp.

References cs, GetListForBlock(), LOCK, and tipIndex.

◆ GetListForBlock()

◆ HandleQuorumCommitment()

◆ IsDIP3Enforced()

bool CDeterministicMNManager::IsDIP3Enforced ( int  nHeight = -1)

◆ IsProTxWithCollateral()

bool CDeterministicMNManager::IsProTxWithCollateral ( const CTransactionRef tx,
uint32_t  n 
)

◆ ProcessBlock()

◆ UndoBlock()

◆ UpdatedBlockTip()

void CDeterministicMNManager::UpdatedBlockTip ( const CBlockIndex pindex)

Definition at line 641 of file deterministicmns.cpp.

References cs, LOCK, and tipIndex.

◆ UpgradeDBIfNeeded()

◆ UpgradeDiff()

Member Data Documentation

◆ cs

◆ DISK_SNAPSHOT_PERIOD

const int CDeterministicMNManager::DISK_SNAPSHOT_PERIOD = 576
staticprivate

Definition at line 639 of file deterministicmns.h.

Referenced by ProcessBlock(), and UpgradeDBIfNeeded().

◆ DISK_SNAPSHOTS

const int CDeterministicMNManager::DISK_SNAPSHOTS = 3
staticprivate

Definition at line 640 of file deterministicmns.h.

◆ evoDb

CEvoDB& CDeterministicMNManager::evoDb
private

◆ LIST_DIFFS_CACHE_SIZE

const int CDeterministicMNManager::LIST_DIFFS_CACHE_SIZE = DISK_SNAPSHOT_PERIOD * DISK_SNAPSHOTS
staticprivate

Definition at line 641 of file deterministicmns.h.

Referenced by CleanupCache().

◆ mnListDiffsCache

std::unordered_map<uint256, CDeterministicMNListDiff, StaticSaltedHasher> CDeterministicMNManager::mnListDiffsCache
private

Definition at line 650 of file deterministicmns.h.

Referenced by CleanupCache(), GetListForBlock(), ProcessBlock(), and UndoBlock().

◆ mnListsCache

std::unordered_map<uint256, CDeterministicMNList, StaticSaltedHasher> CDeterministicMNManager::mnListsCache
private

Definition at line 649 of file deterministicmns.h.

Referenced by CleanupCache(), GetListForBlock(), ProcessBlock(), and UndoBlock().

◆ tipIndex

const CBlockIndex* CDeterministicMNManager::tipIndex {nullptr}
private

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