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

#include <deterministicmns.h>

Collaboration diagram for CDeterministicMNManager:
[legend]

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 SetTipIndex (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 IsDIP3Enforced (int nHeight) const
 
bool IsDIP3Enforced () const
 
bool LegacyMNObsolete (int nHeight) const
 
bool LegacyMNObsolete () const
 
std::vector< CDeterministicMNCPtrGetAllQuorumMembers (Consensus::LLMQType llmqType, const CBlockIndex *pindexQuorum)
 

Public Attributes

RecursiveMutex 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 = 1440
 
static const int DISK_SNAPSHOTS = 3
 
static const int LIST_DIFFS_CACHE_SIZE = DISK_SNAPSHOT_PERIOD * DISK_SNAPSHOTS
 

Detailed Description

Definition at line 554 of file deterministicmns.h.

Constructor & Destructor Documentation

◆ CDeterministicMNManager()

CDeterministicMNManager::CDeterministicMNManager ( CEvoDB _evoDb)
explicit

Definition at line 462 of file deterministicmns.cpp.

Member Function Documentation

◆ BuildNewListFromBlock()

bool CDeterministicMNManager::BuildNewListFromBlock ( const CBlock block,
const CBlockIndex pindexPrev,
CValidationState state,
CDeterministicMNList mnListRet,
bool  debugLogs 
)
Todo:
: remove this when the transition to DMN is complete

Definition at line 567 of file deterministicmns.cpp.

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

◆ CleanupCache()

void CDeterministicMNManager::CleanupCache ( int  nHeight)
private
Todo:
: llmq cache cleanup

Definition at line 949 of file deterministicmns.cpp.

◆ DecreasePoSePenalties()

void CDeterministicMNManager::DecreasePoSePenalties ( CDeterministicMNList mnList)

Definition at line 826 of file deterministicmns.cpp.

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

◆ GetAllQuorumMembers()

std::vector< CDeterministicMNCPtr > CDeterministicMNManager::GetAllQuorumMembers ( Consensus::LLMQType  llmqType,
const CBlockIndex pindexQuorum 
)

Definition at line 975 of file deterministicmns.cpp.

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

◆ GetListAtChainTip()

CDeterministicMNList CDeterministicMNManager::GetListAtChainTip ( )

Definition at line 918 of file deterministicmns.cpp.

Here is the call graph for this function:

◆ GetListForBlock()

CDeterministicMNList CDeterministicMNManager::GetListForBlock ( const CBlockIndex pindex)
Todo:
: keep snapshots for yet alive quorums

Definition at line 843 of file deterministicmns.cpp.

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

◆ HandleQuorumCommitment()

void CDeterministicMNManager::HandleQuorumCommitment ( llmq::CFinalCommitment qc,
const CBlockIndex pindexQuorum,
CDeterministicMNList mnList,
bool  debugLogs 
)

Definition at line 806 of file deterministicmns.cpp.

Here is the call graph for this function:

◆ IsDIP3Enforced() [1/2]

bool CDeterministicMNManager::IsDIP3Enforced ( ) const

Definition at line 932 of file deterministicmns.cpp.

Here is the caller graph for this function:

◆ IsDIP3Enforced() [2/2]

bool CDeterministicMNManager::IsDIP3Enforced ( int  nHeight) const

Definition at line 927 of file deterministicmns.cpp.

Here is the call graph for this function:

◆ LegacyMNObsolete() [1/2]

bool CDeterministicMNManager::LegacyMNObsolete ( ) const

Definition at line 943 of file deterministicmns.cpp.

◆ LegacyMNObsolete() [2/2]

bool CDeterministicMNManager::LegacyMNObsolete ( int  nHeight) const

Definition at line 938 of file deterministicmns.cpp.

Here is the call graph for this function:

◆ ProcessBlock()

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

Definition at line 467 of file deterministicmns.cpp.

Here is the call graph for this function:

◆ SetTipIndex()

void CDeterministicMNManager::SetTipIndex ( const CBlockIndex pindex)

Definition at line 561 of file deterministicmns.cpp.

◆ UndoBlock()

bool CDeterministicMNManager::UndoBlock ( const CBlock block,
const CBlockIndex pindex 
)

Definition at line 526 of file deterministicmns.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ cs

RecursiveMutex CDeterministicMNManager::cs
mutable

Definition at line 561 of file deterministicmns.h.

◆ DISK_SNAPSHOT_PERIOD

const int CDeterministicMNManager::DISK_SNAPSHOT_PERIOD = 1440
staticprivate

Definition at line 556 of file deterministicmns.h.

◆ DISK_SNAPSHOTS

const int CDeterministicMNManager::DISK_SNAPSHOTS = 3
staticprivate

Definition at line 557 of file deterministicmns.h.

◆ evoDb

CEvoDB& CDeterministicMNManager::evoDb
private

Definition at line 564 of file deterministicmns.h.

◆ LIST_DIFFS_CACHE_SIZE

const int CDeterministicMNManager::LIST_DIFFS_CACHE_SIZE = DISK_SNAPSHOT_PERIOD * DISK_SNAPSHOTS
staticprivate

Definition at line 558 of file deterministicmns.h.

◆ mnListDiffsCache

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

Definition at line 567 of file deterministicmns.h.

◆ mnListsCache

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

Definition at line 566 of file deterministicmns.h.

◆ tipIndex

const CBlockIndex* CDeterministicMNManager::tipIndex {nullptr}
private

Definition at line 568 of file deterministicmns.h.


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