25 auto peerData = it->second;
26 auto msgMapIt = peerData.mapMsgData.find(msg);
27 if (msgMapIt != peerData.mapMsgData.end()) {
31 msgMapIt->second.second =
true;
32 LogPrintf(
"%s: %s message updated peer sync state\n", __func__, msgMapIt->first);
38 LogPrintf(
"%s: moving to next assset %s\n", __func__, nextSyncStatus);
58 int retMisbehavingScore{0};
60 if (retMisbehavingScore > 0) {
133 vRecv >> nItemID >> nCount;
164 template <
typename... Args>
170 template <
typename... Args>
175 if (!exist || forceRequest) {
181 PushMessage(pnode, msg, std::forward<Args>(args)...);
190 const auto& msgMapIt = peerData.
mapMsgData.find(msg);
194 PushMessage(pnode, msg, std::forward<Args>(args)...);
201 if (!msgMapIt->second.second) {
202 int64_t lastRequestTime = msgMapIt->second.first;
203 if (lastRequestTime + 600 <
GetTime()) {
205 RequestDataTo(pnode, msg,
true, std::forward<Args>(args)...);
234 LogPrintf(
"REGTEST SYNC FINISHED!\n");
int CountEnabled(bool only_legacy=false) const
int ProcessGetMNList(CNode *pfrom, CTxIn &vin)
std::map< NodeId, TierTwoPeerData > peersSyncState
void ProcessSyncStatusMsg(int nItemID, int itemCount)
void RequestDataTo(CNode *pnode, const char *msg, bool forceRequest, Args &&... args)
void PushMessage(CNode *pnode, const char *msg, Args &&... args)
static int GetNextAsset(int currentAsset)
void SyncRegtest(CNode *pnode)
bool UpdatePeerSyncState(const NodeId &id, const char *msg, const int nextSyncStatus)
bool MessageDispatcher(CNode *pfrom, std::string &strCommand, CDataStream &vRecv)
CSerializedNetMsg Make(int nFlags, std::string sCommand, Args &&... args)
Information about a peer.
int GetSendVersion() const
void ProcessGetSporks(CNode *pfrom, std::string &strCommand, CDataStream &vRecv)
int ProcessSporkMsg(CDataStream &vRecv)
An input of a transaction.
void SetCurrentSyncPhase(int sync_phase)
std::unique_ptr< CDeterministicMNManager > deterministicMNManager
std::unique_ptr< CConnman > g_connman
CMasternodeMan mnodeman
Masternode manager.
UniValue spork(const JSONRPCRequest &request)
const char * QFCOMMITMENT
The qfcommit message is used to propagate LLMQ final commitments.
const char * BUDGETVOTESYNC
The budgetvotesync message is used to request budget vote data from connected peers.
const char * GETMNLIST
The dseg message is used to request the Masternode list or an specific entry.
const char * GETMNWINNERS
The getmnwinners message is used to request winning masternode data from connected peers.
const char * QGETSIGSHARES
const char * QPCOMMITMENT
const char * QJUSTIFICATION
const char * SYNCSTATUSCOUNT
The syncstatuscount message is used to track the layer 2 syncing process.
const char * SPORK
The spork message is used to send spork values to connected peers.
const char * GETSPORKS
The getsporks message is used to request spork data from connected peers.
const char * QSIGSHARESINV
std::unique_ptr< CQuorumBlockProcessor > quorumBlockProcessor
std::unique_ptr< CDKGSessionManager > quorumDKGSessionManager
std::unique_ptr< CSigningManager > quorumSigningManager
std::unique_ptr< CSigSharesManager > quorumSigSharesManager
std::unique_ptr< CChainLocksHandler > chainLocksHandler
void Misbehaving(NodeId pnode, int howmuch, const std::string &message) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Increase a node's misbehavior score.
RecursiveMutex cs_main
Global state.
CSporkManager sporkManager
std::map< const char *, std::pair< int64_t, bool > > mapMsgData
#define WITH_LOCK(cs, code)
Run code while locking a mutex.
TierTwoSyncState g_tiertwo_sync_state
#define MASTERNODE_SYNC_MNW
#define MASTERNODE_SYNC_SPORKS
#define MASTERNODE_SYNC_BUDGET_PROP
#define MASTERNODE_SYNC_BUDGET
#define MASTERNODE_SYNC_BUDGET_FIN
#define MASTERNODE_SYNC_FINISHED
#define MASTERNODE_SYNC_LIST
int64_t GetTime()
DEPRECATED Use either GetSystemTimeInSeconds (not mockable) or GetTime<T> (mockable)