Skip to content

Commit 0729102

Browse files
committed
Net: pass interruptMsgProc as const where possible
1 parent fc7f2ff commit 0729102

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/net_processing.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,7 @@ static void RelayAddress(const CAddress& addr, bool fReachable, CConnman& connma
956956
connman.ForEachNodeThen(std::move(sortfunc), std::move(pushfunc));
957957
}
958958

959-
void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParams, CConnman& connman, std::atomic<bool>& interruptMsgProc)
959+
void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParams, CConnman& connman, const std::atomic<bool>& interruptMsgProc)
960960
{
961961
std::deque<CInv>::iterator it = pfrom->vRecvGetData.begin();
962962
std::vector<CInv> vNotFound;
@@ -1158,7 +1158,7 @@ inline void static SendBlockTransactions(const CBlock& block, const BlockTransac
11581158
connman.PushMessage(pfrom, msgMaker.Make(nSendFlags, NetMsgType::BLOCKTXN, resp));
11591159
}
11601160

1161-
bool static ProcessMessage(CNode* pfrom, std::string strCommand, CDataStream& vRecv, int64_t nTimeReceived, const CChainParams& chainparams, CConnman& connman, std::atomic<bool>& interruptMsgProc)
1161+
bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStream& vRecv, int64_t nTimeReceived, const CChainParams& chainparams, CConnman& connman, const std::atomic<bool>& interruptMsgProc)
11621162
{
11631163
LogPrint("net", "received: %s (%u bytes) peer=%d\n", SanitizeString(strCommand), vRecv.size(), pfrom->id);
11641164
if (IsArgSet("-dropmessagestest") && GetRand(GetArg("-dropmessagestest", 0)) == 0)
@@ -2579,7 +2579,7 @@ bool static ProcessMessage(CNode* pfrom, std::string strCommand, CDataStream& vR
25792579
return true;
25802580
}
25812581

2582-
bool ProcessMessages(CNode* pfrom, CConnman& connman, std::atomic<bool>& interruptMsgProc)
2582+
bool ProcessMessages(CNode* pfrom, CConnman& connman, const std::atomic<bool>& interruptMsgProc)
25832583
{
25842584
const CChainParams& chainparams = Params();
25852585
//
@@ -2712,7 +2712,7 @@ class CompareInvMempoolOrder
27122712
}
27132713
};
27142714

2715-
bool SendMessages(CNode* pto, CConnman& connman, std::atomic<bool>& interruptMsgProc)
2715+
bool SendMessages(CNode* pto, CConnman& connman, const std::atomic<bool>& interruptMsgProc)
27162716
{
27172717
const Consensus::Params& consensusParams = Params().GetConsensus();
27182718
{

src/net_processing.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats);
4949
void Misbehaving(NodeId nodeid, int howmuch);
5050

5151
/** Process protocol messages received from a given node */
52-
bool ProcessMessages(CNode* pfrom, CConnman& connman, std::atomic<bool>& interrupt);
52+
bool ProcessMessages(CNode* pfrom, CConnman& connman, const std::atomic<bool>& interrupt);
5353
/**
5454
* Send queued protocol messages to be sent to a give node.
5555
*
@@ -58,6 +58,6 @@ bool ProcessMessages(CNode* pfrom, CConnman& connman, std::atomic<bool>& interru
5858
* @param[in] interrupt Interrupt condition for processing threads
5959
* @return True if there is more work to be done
6060
*/
61-
bool SendMessages(CNode* pto, CConnman& connman, std::atomic<bool>& interrupt);
61+
bool SendMessages(CNode* pto, CConnman& connman, const std::atomic<bool>& interrupt);
6262

6363
#endif // BITCOIN_NET_PROCESSING_H

0 commit comments

Comments
 (0)