17
17
#include < masternode/meta.h>
18
18
#include < masternode/node.h>
19
19
#include < masternode/sync.h>
20
+ #include < net_processing.h>
20
21
#include < netfulfilledman.h>
21
22
#include < netmessagemaker.h>
22
23
#include < protocol.h>
@@ -141,9 +142,9 @@ PeerMsgRet CGovernanceManager::ProcessMessage(CNode& peer, CConnman& connman, Pe
141
142
142
143
LogPrint (BCLog::GOBJECT, " MNGOVERNANCESYNC -- syncing governance objects to our peer %s\n " , peer.GetLogString ());
143
144
if (nProp == uint256 ()) {
144
- return SyncObjects (peer, connman);
145
+ return SyncObjects (peer, peerman, connman);
145
146
} else {
146
- SyncSingleObjVotes (peer, nProp, filter, connman);
147
+ SyncSingleObjVotes (peer, peerman, nProp, filter, connman);
147
148
}
148
149
}
149
150
@@ -858,7 +859,7 @@ bool CGovernanceManager::ConfirmInventoryRequest(const CInv& inv)
858
859
return true ;
859
860
}
860
861
861
- void CGovernanceManager::SyncSingleObjVotes (CNode& peer, const uint256& nProp, const CBloomFilter& filter, CConnman& connman)
862
+ void CGovernanceManager::SyncSingleObjVotes (CNode& peer, PeerManager& peerman, const uint256& nProp, const CBloomFilter& filter, CConnman& connman)
862
863
{
863
864
// do not provide any data until our node is synced
864
865
if (!Assert (m_mn_sync)->IsSynced ()) return ;
@@ -899,7 +900,7 @@ void CGovernanceManager::SyncSingleObjVotes(CNode& peer, const uint256& nProp, c
899
900
if (filter.contains (nVoteHash) || !vote.IsValid (tip_mn_list, onlyVotingKeyAllowed)) {
900
901
continue ;
901
902
}
902
- peer .PushInventory (CInv (MSG_GOVERNANCE_OBJECT_VOTE, nVoteHash));
903
+ peerman .PushInventory (peer. GetId (), CInv (MSG_GOVERNANCE_OBJECT_VOTE, nVoteHash));
903
904
++nVoteCount;
904
905
}
905
906
@@ -908,7 +909,7 @@ void CGovernanceManager::SyncSingleObjVotes(CNode& peer, const uint256& nProp, c
908
909
LogPrint (BCLog::GOBJECT, " CGovernanceManager::%s -- sent %d votes to peer=%d\n " , __func__, nVoteCount, peer.GetId ());
909
910
}
910
911
911
- PeerMsgRet CGovernanceManager::SyncObjects (CNode& peer, CConnman& connman) const
912
+ PeerMsgRet CGovernanceManager::SyncObjects (CNode& peer, PeerManager& peerman, CConnman& connman) const
912
913
{
913
914
assert (m_netfulfilledman.IsValid ());
914
915
@@ -959,7 +960,7 @@ PeerMsgRet CGovernanceManager::SyncObjects(CNode& peer, CConnman& connman) const
959
960
960
961
// Push the inventory budget proposal message over to the other client
961
962
LogPrint (BCLog::GOBJECT, " CGovernanceManager::%s -- syncing govobj: %s, peer=%d\n " , __func__, strHash, peer.GetId ());
962
- peer .PushInventory (CInv (MSG_GOVERNANCE_OBJECT, nHash));
963
+ peerman .PushInventory (peer. GetId (), CInv (MSG_GOVERNANCE_OBJECT, nHash));
963
964
++nObjCount;
964
965
}
965
966
0 commit comments