Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
#include <masternode-sync.h>
Public Member Functions | |
CMasternodeSync () | |
void | SendGovernanceSyncRequest (CNode *pnode, CConnman &connman) |
bool | IsBlockchainSynced () |
bool | IsSynced () |
int | GetAssetID () |
int | GetAttempt () |
void | BumpAssetLastTime (const std::string &strFuncName) |
int64_t | GetAssetStartTime () |
std::string | GetAssetName () |
std::string | GetSyncStatus () |
void | Reset (bool fForce=false, bool fNotifyReset=true) |
void | SwitchToNextAsset (CConnman &connman) |
void | ProcessMessage (CNode *pfrom, const std::string &strCommand, CDataStream &vRecv) |
void | ProcessTick (CConnman &connman) |
void | AcceptedBlockHeader (const CBlockIndex *pindexNew) |
void | NotifyHeaderTip (const CBlockIndex *pindexNew, bool fInitialDownload, CConnman &connman) |
void | UpdatedBlockTip (const CBlockIndex *pindexNew, bool fInitialDownload, CConnman &connman) |
void | DoMaintenance (CConnman &connman) |
Private Attributes | |
int | nCurrentAsset |
int | nTriedPeerCount |
int64_t | nTimeAssetSyncStarted |
int64_t | nTimeLastBumped |
bool | fReachedBestHeader {false} |
Set to true if best header is reached in CMasternodeSync::UpdatedBlockTip. More... | |
int64_t | nTimeLastUpdateBlockTip {0} |
Last time UpdateBlockTip has been called. More... | |
Detailed Description
Definition at line 28 of file masternode-sync.h.
Constructor & Destructor Documentation
◆ CMasternodeSync()
|
inline |
Definition at line 47 of file masternode-sync.h.
References Reset().
Member Function Documentation
◆ AcceptedBlockHeader()
void CMasternodeSync::AcceptedBlockHeader | ( | const CBlockIndex * | pindexNew | ) |
Definition at line 308 of file masternode-sync.cpp.
References BumpAssetLastTime(), IsBlockchainSynced(), LogPrint, BCLog::MNSYNC, and CBlockIndex::nHeight.
Referenced by CDSNotificationInterface::AcceptedBlockHeader().
◆ BumpAssetLastTime()
void CMasternodeSync::BumpAssetLastTime | ( | const std::string & | strFuncName | ) |
Definition at line 35 of file masternode-sync.cpp.
References GetTime(), IsSynced(), LogPrint, BCLog::MNSYNC, and nTimeLastBumped.
Referenced by AcceptedBlockHeader(), CGovernanceManager::AddGovernanceObject(), NotifyHeaderTip(), CGovernanceManager::ProcessMessage(), SwitchToNextAsset(), and UpdatedBlockTip().
◆ DoMaintenance()
void CMasternodeSync::DoMaintenance | ( | CConnman & | connman | ) |
Definition at line 371 of file masternode-sync.cpp.
References ProcessTick(), and ShutdownRequested().
Referenced by AppInitMain().
◆ GetAssetID()
|
inline |
◆ GetAssetName()
std::string CMasternodeSync::GetAssetName | ( | ) |
Definition at line 42 of file masternode-sync.cpp.
References MASTERNODE_SYNC_BLOCKCHAIN, MASTERNODE_SYNC_FINISHED, MASTERNODE_SYNC_GOVERNANCE, and nCurrentAsset.
Referenced by mnsync(), ProcessTick(), and SwitchToNextAsset().
◆ GetAssetStartTime()
|
inline |
Definition at line 58 of file masternode-sync.h.
References nTimeAssetSyncStarted.
Referenced by mnsync().
◆ GetAttempt()
|
inline |
Definition at line 56 of file masternode-sync.h.
References nTriedPeerCount.
Referenced by mnsync().
◆ GetSyncStatus()
std::string CMasternodeSync::GetSyncStatus | ( | ) |
Definition at line 79 of file masternode-sync.cpp.
References _(), MASTERNODE_SYNC_BLOCKCHAIN, MASTERNODE_SYNC_FINISHED, MASTERNODE_SYNC_GOVERNANCE, masternodeSync, and nCurrentAsset.
Referenced by BitcoinGUI::setAdditionalDataSyncProgress().
◆ IsBlockchainSynced()
|
inline |
Definition at line 52 of file masternode-sync.h.
References MASTERNODE_SYNC_BLOCKCHAIN, and nCurrentAsset.
Referenced by AcceptedBlockHeader(), llmq::CChainLocksHandler::BlockConnected(), llmq::CChainLocksHandler::Cleanup(), CGovernanceManager::ConfirmInventoryRequest(), CPrivateSendClientSession::DoAutomaticDenominating(), CPrivateSendClientManager::DoAutomaticDenominating(), CMasternodeUtils::DoMaintenance(), CPrivateSendServer::DoMaintenance(), CPrivateSendClientManager::DoMaintenance(), CPrivateSendClientSession::GetStatus(), gobject_submit(), mnsync(), CPrivateSend::NotifyChainLock(), NotifyHeaderTip(), OverviewPage::privateSendStatus(), CMNAuth::ProcessMessage(), CPrivateSendServer::ProcessMessage(), CPrivateSendClientSession::ProcessMessage(), CPrivateSendClientManager::ProcessMessage(), CGovernanceManager::ProcessMessage(), llmq::CInstantSendManager::ProcessNewTransaction(), llmq::CInstantSendManager::ProcessTx(), BitcoinGUI::setAdditionalDataSyncProgress(), BitcoinGUI::setNumBlocks(), CConnman::ThreadOpenMasternodeConnections(), llmq::CChainLocksHandler::TrySignChainTip(), CGovernanceManager::UpdateCachesAndClean(), UpdatedBlockTip(), llmq::CQuorumManager::UpdatedBlockTip(), CPrivateSend::UpdatedBlockTip(), MasternodeList::updateDIP3ListScheduled(), OverviewPage::updatePrivateSendProgress(), and CPrivateSendClientManager::WaitForAnotherBlock().
◆ IsSynced()
|
inline |
Definition at line 53 of file masternode-sync.h.
References MASTERNODE_SYNC_FINISHED, and nCurrentAsset.
Referenced by CConnman::AcceptConnection(), BumpAssetLastTime(), BitcoinGUI::changeEvent(), CGovernanceManager::CheckPostponedObjects(), CGovernanceManager::DoMaintenance(), getblocktemplate(), IsBlockValueValid(), IsOldBudgetBlockValueValid(), CGovernanceManager::MasternodeRateCheck(), mnsync(), NotifyHeaderTip(), ProcessMessage(), CGovernanceManager::ProcessMessage(), ProcessTick(), CGovernanceVote::Relay(), CGovernanceObject::Relay(), CGovernanceManager::RemoveInvalidVotes(), BitcoinGUI::setAdditionalDataSyncProgress(), BitcoinGUI::setNumBlocks(), CGovernanceManager::SyncObjects(), CGovernanceManager::SyncSingleObjVotes(), UpdatedBlockTip(), BitcoinGUI::updateNetworkState(), and BitcoinGUI::updateProgressBarVisibility().
◆ NotifyHeaderTip()
void CMasternodeSync::NotifyHeaderTip | ( | const CBlockIndex * | pindexNew, |
bool | fInitialDownload, | ||
CConnman & | connman | ||
) |
Definition at line 318 of file masternode-sync.cpp.
References BumpAssetLastTime(), IsBlockchainSynced(), IsSynced(), LogPrint, BCLog::MNSYNC, CBlockIndex::nHeight, and pindexBestHeader.
Referenced by CDSNotificationInterface::NotifyHeaderTip().
◆ ProcessMessage()
void CMasternodeSync::ProcessMessage | ( | CNode * | pfrom, |
const std::string & | strCommand, | ||
CDataStream & | vRecv | ||
) |
Definition at line 89 of file masternode-sync.cpp.
References CNode::GetId(), IsSynced(), LogPrintf, and NetMsgType::SYNCSTATUSCOUNT.
Referenced by ProcessMessage().
◆ ProcessTick()
void CMasternodeSync::ProcessTick | ( | CConnman & | connman | ) |
Definition at line 104 of file masternode-sync.cpp.
References CNetFulfilledRequestManager::AddFulfilledRequest(), CConnman::CopyNodeVector(), DEFAULT_SYNC_MEMPOOL, fDisableGovernance, fMasternodeMode, fReachedBestHeader, CConnman::FullyConnectedOnly, gArgs, GetAssetName(), ArgsManager::GetBoolArg(), NetMsgType::GETSPORKS, GetTime(), GetTimeMillis(), CGovernanceManager::GetVoteCount(), BCLog::GOBJECT, governance, CNetFulfilledRequestManager::HasFulfilledRequest(), IsSynced(), LogPrint, LogPrintf, MASTERNODE_SYNC_BLOCKCHAIN, MASTERNODE_SYNC_GOVERNANCE, MASTERNODE_SYNC_TICK_SECONDS, MASTERNODE_SYNC_TIMEOUT_SECONDS, NetMsgType::MEMPOOL, MIN_GOVERNANCE_PEER_PROTO_VERSION, nCurrentAsset, netfulfilledman, CChainParams::NetworkIDString(), CClientUIInterface::NotifyAdditionalDataSyncProgressChanged, nTimeLastBumped, nTriedPeerCount, Params(), CConnman::PushMessage(), CBaseChainParams::REGTEST, CConnman::ReleaseNodeVector(), CNetFulfilledRequestManager::RemoveAllFulfilledRequests(), CGovernanceManager::RequestGovernanceObjectVotes(), Reset(), SendGovernanceSyncRequest(), strprintf, SwitchToNextAsset(), and uiInterface.
Referenced by DoMaintenance().
◆ Reset()
Definition at line 19 of file masternode-sync.cpp.
References fReachedBestHeader, GetTime(), MASTERNODE_SYNC_BLOCKCHAIN, MASTERNODE_SYNC_RESET_SECONDS, nCurrentAsset, CClientUIInterface::NotifyAdditionalDataSyncProgressChanged, nTimeAssetSyncStarted, nTimeLastBumped, nTimeLastUpdateBlockTip, nTriedPeerCount, and uiInterface.
Referenced by CMasternodeSync(), mnsync(), CConnman::NotifyNumConnectionsChanged(), ProcessTick(), CConnman::SetNetworkActive(), and UpdatedBlockTip().
◆ SendGovernanceSyncRequest()
Definition at line 293 of file masternode-sync.cpp.
References CBloomFilter::clear(), CNode::GetSendVersion(), GOVERNANCE_FILTER_PROTO_VERSION, NetMsgType::MNGOVERNANCESYNC, CNode::nVersion, and CConnman::PushMessage().
Referenced by ProcessTick().
◆ SwitchToNextAsset()
void CMasternodeSync::SwitchToNextAsset | ( | CConnman & | connman | ) |
Definition at line 53 of file masternode-sync.cpp.
References CNetFulfilledRequestManager::AddFulfilledRequest(), CNode::addr, CConnman::AllNodes, BumpAssetLastTime(), CConnman::ForEachNode(), GetAssetName(), GetTime(), LogPrintf, MASTERNODE_SYNC_BLOCKCHAIN, MASTERNODE_SYNC_FINISHED, MASTERNODE_SYNC_GOVERNANCE, nCurrentAsset, netfulfilledman, CClientUIInterface::NotifyAdditionalDataSyncProgressChanged, nTimeAssetSyncStarted, nTriedPeerCount, and uiInterface.
Referenced by mnsync(), and ProcessTick().
◆ UpdatedBlockTip()
void CMasternodeSync::UpdatedBlockTip | ( | const CBlockIndex * | pindexNew, |
bool | fInitialDownload, | ||
CConnman & | connman | ||
) |
Definition at line 331 of file masternode-sync.cpp.
References BumpAssetLastTime(), fReachedBestHeader, GetAdjustedTime(), CBlockIndex::GetBlockHash(), IsBlockchainSynced(), IsSynced(), LogPrint, BCLog::MNSYNC, CBlockIndex::nHeight, nTimeLastUpdateBlockTip, pindexBestHeader, and Reset().
Referenced by CDSNotificationInterface::UpdatedBlockTip().
Member Data Documentation
◆ fReachedBestHeader
|
private |
Set to true if best header is reached in CMasternodeSync::UpdatedBlockTip.
Definition at line 42 of file masternode-sync.h.
Referenced by ProcessTick(), Reset(), and UpdatedBlockTip().
◆ nCurrentAsset
|
private |
Definition at line 32 of file masternode-sync.h.
Referenced by GetAssetID(), GetAssetName(), GetSyncStatus(), IsBlockchainSynced(), IsSynced(), ProcessTick(), Reset(), and SwitchToNextAsset().
◆ nTimeAssetSyncStarted
|
private |
Definition at line 37 of file masternode-sync.h.
Referenced by GetAssetStartTime(), Reset(), and SwitchToNextAsset().
◆ nTimeLastBumped
|
private |
Definition at line 39 of file masternode-sync.h.
Referenced by BumpAssetLastTime(), ProcessTick(), and Reset().
◆ nTimeLastUpdateBlockTip
|
private |
Last time UpdateBlockTip has been called.
Definition at line 44 of file masternode-sync.h.
Referenced by Reset(), and UpdatedBlockTip().
◆ nTriedPeerCount
|
private |
Definition at line 34 of file masternode-sync.h.
Referenced by GetAttempt(), ProcessTick(), Reset(), and SwitchToNextAsset().
The documentation for this class was generated from the following files:
- src/masternode/masternode-sync.h
- src/masternode/masternode-sync.cpp