diff --git a/src/masternode-sync.cpp b/src/masternode-sync.cpp index 0ea007ae8..8db13e76b 100644 --- a/src/masternode-sync.cpp +++ b/src/masternode-sync.cpp @@ -64,12 +64,10 @@ void CMasternodeSync::SwitchToNextAsset(CConnman& connman) throw std::runtime_error("Can't switch to next asset from failed, should use Reset() first!"); break; case(MASTERNODE_SYNC_INITIAL): - ClearFulfilledRequests(connman); nRequestedMasternodeAssets = MASTERNODE_SYNC_WAITING; LogPrintf("CMasternodeSync::SwitchToNextAsset -- Starting %s\n", GetAssetName()); break; case(MASTERNODE_SYNC_WAITING): - ClearFulfilledRequests(connman); LogPrintf("CMasternodeSync::SwitchToNextAsset -- Completed %s in %llds\n", GetAssetName(), GetTime() - nTimeAssetSyncStarted); nRequestedMasternodeAssets = MASTERNODE_SYNC_LIST; LogPrintf("CMasternodeSync::SwitchToNextAsset -- Starting %s\n", GetAssetName()); @@ -132,17 +130,6 @@ void CMasternodeSync::ProcessMessage(CNode* pfrom, const std::string& strCommand } } -void CMasternodeSync::ClearFulfilledRequests(CConnman& connman) -{ - connman.ForEachNode(CConnman::AllNodes, [](CNode* pnode) { - netfulfilledman.RemoveFulfilledRequest(pnode->addr, "spork-sync"); - netfulfilledman.RemoveFulfilledRequest(pnode->addr, "masternode-list-sync"); - netfulfilledman.RemoveFulfilledRequest(pnode->addr, "masternode-payment-sync"); - netfulfilledman.RemoveFulfilledRequest(pnode->addr, "governance-sync"); - netfulfilledman.RemoveFulfilledRequest(pnode->addr, "full-sync"); - }); -} - void CMasternodeSync::ProcessTick(CConnman& connman) { static int nTick = 0; diff --git a/src/masternode-sync.h b/src/masternode-sync.h index 56b14ef72..40b13b258 100644 --- a/src/masternode-sync.h +++ b/src/masternode-sync.h @@ -48,7 +48,6 @@ private: int64_t nTimeLastFailure; void Fail(); - void ClearFulfilledRequests(CConnman& connman); public: CMasternodeSync() { Reset(); } diff --git a/src/netfulfilledman.h b/src/netfulfilledman.h index f61708d38..c1b2e1c17 100644 --- a/src/netfulfilledman.h +++ b/src/netfulfilledman.h @@ -24,6 +24,8 @@ private: fulfilledreqmap_t mapFulfilledRequests; CCriticalSection cs_mapFulfilledRequests; + void RemoveFulfilledRequest(const CService& addr, const std::string& strRequest); + public: CNetFulfilledRequestManager() {} @@ -37,7 +39,6 @@ public: void AddFulfilledRequest(const CService& addr, const std::string& strRequest); bool HasFulfilledRequest(const CService& addr, const std::string& strRequest); - void RemoveFulfilledRequest(const CService& addr, const std::string& strRequest); void CheckAndRemove(); void Clear(); diff --git a/src/privatesend.cpp b/src/privatesend.cpp index c61685ba4..8e5ab8c62 100644 --- a/src/privatesend.cpp +++ b/src/privatesend.cpp @@ -12,6 +12,7 @@ #include "masternode-sync.h" #include "masternodeman.h" #include "messagesigner.h" +#include "netfulfilledman.h" #include "netmessagemaker.h" #include "script/sign.h" #include "txmempool.h" @@ -545,6 +546,7 @@ void ThreadCheckPrivateSend(CConnman& connman) activeMasternode.ManageState(connman); if(nTick % 60 == 0) { + netfulfilledman.CheckAndRemove(); mnodeman.ProcessMasternodeConnections(connman); mnodeman.CheckAndRemove(connman); mnodeman.WarnMasternodeDaemonUpdates();