|
15 | 15 | #include <governance/validators.h> |
16 | 16 | #include <masternode/meta.h> |
17 | 17 | #include <masternode/sync.h> |
18 | | -#include <netfulfilledman.h> |
19 | 18 | #include <netmessagemaker.h> |
20 | 19 | #include <protocol.h> |
21 | 20 | #include <shutdown.h> |
@@ -63,12 +62,11 @@ GovernanceStore::GovernanceStore() : |
63 | 62 | { |
64 | 63 | } |
65 | 64 |
|
66 | | -CGovernanceManager::CGovernanceManager(CMasternodeMetaMan& mn_metaman, CNetFulfilledRequestManager& netfulfilledman, |
| 65 | +CGovernanceManager::CGovernanceManager(CMasternodeMetaMan& mn_metaman, |
67 | 66 | const ChainstateManager& chainman, |
68 | 67 | const std::unique_ptr<CDeterministicMNManager>& dmnman, CMasternodeSync& mn_sync) : |
69 | 68 | m_db{std::make_unique<db_type>("governance.dat", "magicGovernanceCache")}, |
70 | 69 | m_mn_metaman{mn_metaman}, |
71 | | - m_netfulfilledman{netfulfilledman}, |
72 | 70 | m_chainman{chainman}, |
73 | 71 | m_dmnman{dmnman}, |
74 | 72 | m_mn_sync{mn_sync}, |
@@ -649,18 +647,9 @@ MessageProcessingResult CGovernanceManager::SyncSingleObjVotes(CNode& peer, cons |
649 | 647 | MessageProcessingResult CGovernanceManager::SyncObjects(CNode& peer, CConnman& connman) const |
650 | 648 | { |
651 | 649 | LOCK(cs_store); |
652 | | - assert(m_netfulfilledman.IsValid()); |
653 | | - |
654 | 650 | // do not provide any data until our node is synced |
655 | 651 | if (!m_mn_sync.IsSynced()) return {}; |
656 | 652 |
|
657 | | - if (m_netfulfilledman.HasFulfilledRequest(peer.addr, NetMsgType::MNGOVERNANCESYNC)) { |
658 | | - // Asking for the whole list multiple times in a short period of time is no good |
659 | | - LogPrint(BCLog::GOBJECT, "CGovernanceManager::%s -- peer already asked me for the list\n", __func__); |
660 | | - return MisbehavingError{20}; |
661 | | - } |
662 | | - m_netfulfilledman.AddFulfilledRequest(peer.addr, NetMsgType::MNGOVERNANCESYNC); |
663 | | - |
664 | 653 | // SYNC GOVERNANCE OBJECTS WITH OTHER CLIENT |
665 | 654 |
|
666 | 655 | LogPrint(BCLog::GOBJECT, "CGovernanceManager::%s -- syncing all objects to peer=%d\n", __func__, peer.GetId()); |
|
0 commit comments