30
30
#include < memory>
31
31
#include < univalue.h>
32
32
33
- PeerMsgRet CCoinJoinClientQueueManager::ProcessMessage (const CNode& peer, std::string_view msg_type, CDataStream& vRecv)
33
+ PeerMsgRet CCoinJoinClientQueueManager::ProcessMessage (const CNode& peer, CConnman& connman, PeerManager& peerman,
34
+ std::string_view msg_type, CDataStream& vRecv)
34
35
{
35
36
if (m_is_masternode) return {};
36
37
if (!m_mn_sync.IsBlockchainSynced ()) return {};
37
38
38
39
if (msg_type == NetMsgType::DSQUEUE) {
39
- return CCoinJoinClientQueueManager::ProcessDSQueue (peer, vRecv);
40
+ return CCoinJoinClientQueueManager::ProcessDSQueue (peer, connman, peerman, vRecv);
40
41
}
41
42
return {};
42
43
}
43
44
44
- PeerMsgRet CCoinJoinClientQueueManager::ProcessDSQueue (const CNode& peer, CDataStream& vRecv)
45
+ PeerMsgRet CCoinJoinClientQueueManager::ProcessDSQueue (const CNode& peer, CConnman& connman, PeerManager& peerman,
46
+ CDataStream& vRecv)
45
47
{
46
48
assert (m_mn_metaman.IsValid ());
47
49
@@ -50,7 +52,7 @@ PeerMsgRet CCoinJoinClientQueueManager::ProcessDSQueue(const CNode& peer, CDataS
50
52
51
53
{
52
54
LOCK (cs_main);
53
- Assert ( peerman)-> EraseObjectRequest (peer.GetId (), CInv (MSG_DSQ, dsq.GetHash ()));
55
+ peerman. EraseObjectRequest (peer.GetId (), CInv (MSG_DSQ, dsq.GetHash ()));
54
56
}
55
57
56
58
if (dsq.masternodeOutpoint .IsNull () && dsq.m_protxHash .IsNull ()) {
@@ -102,8 +104,9 @@ PeerMsgRet CCoinJoinClientQueueManager::ProcessDSQueue(const CNode& peer, CDataS
102
104
}
103
105
104
106
// if the queue is ready, submit if we can
105
- if (dsq.fReady && m_walletman.ForAnyCJClientMan ([this , &dmn](std::unique_ptr<CCoinJoinClientManager>& clientman) {
106
- return clientman->TrySubmitDenominate (dmn->pdmnState ->addr , this ->connman );
107
+ if (dsq.fReady &&
108
+ m_walletman.ForAnyCJClientMan ([this , &connman, &dmn](std::unique_ptr<CCoinJoinClientManager>& clientman) {
109
+ return clientman->TrySubmitDenominate (dmn->pdmnState ->addr , connman);
107
110
})) {
108
111
LogPrint (BCLog::COINJOIN, " DSQUEUE -- CoinJoin queue (%s) is ready on masternode %s\n " , dsq.ToString (),
109
112
dmn->pdmnState ->addr .ToStringAddrPort ());
@@ -132,7 +135,7 @@ PeerMsgRet CCoinJoinClientQueueManager::ProcessDSQueue(const CNode& peer, CDataS
132
135
WITH_LOCK (cs_vecqueue, vecCoinJoinQueue.push_back (dsq));
133
136
}
134
137
} // cs_ProcessDSQueue
135
- peerman-> RelayDSQ (dsq);
138
+ peerman. RelayDSQ (dsq);
136
139
return {};
137
140
}
138
141
0 commit comments