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

#include <masternode-sync.h>

Public Member Functions

 CMasternodeSync ()
 
void SwitchToNextAsset ()
 
std::string GetSyncStatus ()
 
void ProcessSyncStatusMsg (int nItemID, int itemCount)
 
bool IsBudgetFinEmpty ()
 
bool IsBudgetPropEmpty ()
 
void Reset ()
 
void Process ()
 
bool SyncWithNode (CNode *pnode, bool fLegacyMnObsolete)
 
bool NotCompleted ()
 
void UpdateBlockchainSynced (bool isRegTestNet)
 
void ClearFulfilledRequest ()
 
bool MessageDispatcher (CNode *pfrom, std::string &strCommand, CDataStream &vRecv)
 

Public Attributes

int64_t lastFailure
 
int nCountFailures
 
std::atomic< int64_t > lastProcess
 
int sumMasternodeList
 
int sumMasternodeWinner
 
int sumBudgetItemProp
 
int sumBudgetItemFin
 
int countMasternodeList
 
int countMasternodeWinner
 
int countBudgetItemProp
 
int countBudgetItemFin
 
int RequestedMasternodeAttempt
 
int64_t nAssetSyncStarted
 

Private Member Functions

void SyncRegtest (CNode *pnode)
 
template<typename... Args>
void RequestDataTo (CNode *pnode, const char *msg, bool forceRequest, Args &&... args)
 
template<typename... Args>
void PushMessage (CNode *pnode, const char *msg, Args &&... args)
 
bool UpdatePeerSyncState (const NodeId &id, const char *msg, const int nextSyncStatus)
 
void CheckAndUpdateSyncStatus ()
 
void syncTimeout (const std::string &reason)
 

Static Private Member Functions

static int GetNextAsset (int currentAsset)
 

Private Attributes

std::map< NodeId, TierTwoPeerDatapeersSyncState
 

Detailed Description

Definition at line 30 of file masternode-sync.h.

Constructor & Destructor Documentation

◆ CMasternodeSync()

CMasternodeSync::CMasternodeSync ( )

Definition at line 25 of file masternode-sync.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ CheckAndUpdateSyncStatus()

void CMasternodeSync::CheckAndUpdateSyncStatus ( )
private

◆ ClearFulfilledRequest()

void CMasternodeSync::ClearFulfilledRequest ( )

Definition at line 179 of file masternode-sync.cpp.

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

◆ GetNextAsset()

int CMasternodeSync::GetNextAsset ( int  currentAsset)
staticprivate

Definition at line 86 of file masternode-sync.cpp.

Here is the caller graph for this function:

◆ GetSyncStatus()

std::string CMasternodeSync::GetSyncStatus ( )

Definition at line 124 of file masternode-sync.cpp.

Here is the call graph for this function:

◆ IsBudgetFinEmpty()

bool CMasternodeSync::IsBudgetFinEmpty ( )

Definition at line 81 of file masternode-sync.cpp.

◆ IsBudgetPropEmpty()

bool CMasternodeSync::IsBudgetPropEmpty ( )

Definition at line 76 of file masternode-sync.cpp.

◆ MessageDispatcher()

bool CMasternodeSync::MessageDispatcher ( CNode pfrom,
std::string &  strCommand,
CDataStream vRecv 
)
Todo:
: This could be a MASTERNODE_SYNC_BUDGET_FIN as well, possibly should decouple the finalization budget sync

Definition at line 47 of file tiertwo_networksync.cpp.

Here is the call graph for this function:

◆ NotCompleted()

bool CMasternodeSync::NotCompleted ( )

Definition at line 30 of file masternode-sync.cpp.

Here is the call graph for this function:

◆ Process()

void CMasternodeSync::Process ( )
Todo:
: remove when transition to DMN is complete

Definition at line 184 of file masternode-sync.cpp.

Here is the call graph for this function:

◆ ProcessSyncStatusMsg()

void CMasternodeSync::ProcessSyncStatusMsg ( int  nItemID,
int  itemCount 
)

Definition at line 145 of file masternode-sync.cpp.

Here is the call graph for this function:

◆ PushMessage()

template<typename... Args>
void CMasternodeSync::PushMessage ( CNode pnode,
const char *  msg,
Args &&...  args 
)
private

Definition at line 165 of file tiertwo_networksync.cpp.

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

◆ RequestDataTo()

template<typename... Args>
void CMasternodeSync::RequestDataTo ( CNode pnode,
const char *  msg,
bool  forceRequest,
Args &&...  args 
)
private

Definition at line 171 of file tiertwo_networksync.cpp.

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

◆ Reset()

void CMasternodeSync::Reset ( )

Definition at line 56 of file masternode-sync.cpp.

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

◆ SwitchToNextAsset()

void CMasternodeSync::SwitchToNextAsset ( )

Definition at line 108 of file masternode-sync.cpp.

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

◆ SyncRegtest()

void CMasternodeSync::SyncRegtest ( CNode pnode)
private

Definition at line 213 of file tiertwo_networksync.cpp.

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

◆ syncTimeout()

void CMasternodeSync::syncTimeout ( const std::string &  reason)
private

Definition at line 251 of file masternode-sync.cpp.

Here is the caller graph for this function:

◆ SyncWithNode()

bool CMasternodeSync::SyncWithNode ( CNode pnode,
bool  fLegacyMnObsolete 
)

Definition at line 260 of file masternode-sync.cpp.

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

◆ UpdateBlockchainSynced()

void CMasternodeSync::UpdateBlockchainSynced ( bool  isRegTestNet)

Definition at line 39 of file masternode-sync.cpp.

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

◆ UpdatePeerSyncState()

bool CMasternodeSync::UpdatePeerSyncState ( const NodeId id,
const char *  msg,
const int  nextSyncStatus 
)
private
Todo:
: this should only happen if more than N peers have sent the data.

Definition at line 21 of file tiertwo_networksync.cpp.

Member Data Documentation

◆ countBudgetItemFin

int CMasternodeSync::countBudgetItemFin

Definition at line 47 of file masternode-sync.h.

◆ countBudgetItemProp

int CMasternodeSync::countBudgetItemProp

Definition at line 46 of file masternode-sync.h.

◆ countMasternodeList

int CMasternodeSync::countMasternodeList

Definition at line 44 of file masternode-sync.h.

◆ countMasternodeWinner

int CMasternodeSync::countMasternodeWinner

Definition at line 45 of file masternode-sync.h.

◆ lastFailure

int64_t CMasternodeSync::lastFailure

Definition at line 33 of file masternode-sync.h.

◆ lastProcess

std::atomic<int64_t> CMasternodeSync::lastProcess

Definition at line 36 of file masternode-sync.h.

◆ nAssetSyncStarted

int64_t CMasternodeSync::nAssetSyncStarted

Definition at line 53 of file masternode-sync.h.

◆ nCountFailures

int CMasternodeSync::nCountFailures

Definition at line 34 of file masternode-sync.h.

◆ peersSyncState

std::map<NodeId, TierTwoPeerData> CMasternodeSync::peersSyncState
private

Definition at line 82 of file masternode-sync.h.

◆ RequestedMasternodeAttempt

int CMasternodeSync::RequestedMasternodeAttempt

Definition at line 50 of file masternode-sync.h.

◆ sumBudgetItemFin

int CMasternodeSync::sumBudgetItemFin

Definition at line 42 of file masternode-sync.h.

◆ sumBudgetItemProp

int CMasternodeSync::sumBudgetItemProp

Definition at line 41 of file masternode-sync.h.

◆ sumMasternodeList

int CMasternodeSync::sumMasternodeList

Definition at line 39 of file masternode-sync.h.

◆ sumMasternodeWinner

int CMasternodeSync::sumMasternodeWinner

Definition at line 40 of file masternode-sync.h.


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