From 0729102f99241b9716456ad40bf778c09f650b1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Tim=C3=B3n?= Date: Tue, 31 Jan 2017 23:07:20 +0100 Subject: [PATCH] Net: pass interruptMsgProc as const where possible --- src/net_processing.cpp | 8 ++++---- src/net_processing.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 99577933810..1cc86a66268 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -956,7 +956,7 @@ static void RelayAddress(const CAddress& addr, bool fReachable, CConnman& connma connman.ForEachNodeThen(std::move(sortfunc), std::move(pushfunc)); } -void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParams, CConnman& connman, std::atomic& interruptMsgProc) +void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParams, CConnman& connman, const std::atomic& interruptMsgProc) { std::deque::iterator it = pfrom->vRecvGetData.begin(); std::vector vNotFound; @@ -1158,7 +1158,7 @@ inline void static SendBlockTransactions(const CBlock& block, const BlockTransac connman.PushMessage(pfrom, msgMaker.Make(nSendFlags, NetMsgType::BLOCKTXN, resp)); } -bool static ProcessMessage(CNode* pfrom, std::string strCommand, CDataStream& vRecv, int64_t nTimeReceived, const CChainParams& chainparams, CConnman& connman, std::atomic& interruptMsgProc) +bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStream& vRecv, int64_t nTimeReceived, const CChainParams& chainparams, CConnman& connman, const std::atomic& interruptMsgProc) { LogPrint("net", "received: %s (%u bytes) peer=%d\n", SanitizeString(strCommand), vRecv.size(), pfrom->id); if (IsArgSet("-dropmessagestest") && GetRand(GetArg("-dropmessagestest", 0)) == 0) @@ -2579,7 +2579,7 @@ bool static ProcessMessage(CNode* pfrom, std::string strCommand, CDataStream& vR return true; } -bool ProcessMessages(CNode* pfrom, CConnman& connman, std::atomic& interruptMsgProc) +bool ProcessMessages(CNode* pfrom, CConnman& connman, const std::atomic& interruptMsgProc) { const CChainParams& chainparams = Params(); // @@ -2712,7 +2712,7 @@ public: } }; -bool SendMessages(CNode* pto, CConnman& connman, std::atomic& interruptMsgProc) +bool SendMessages(CNode* pto, CConnman& connman, const std::atomic& interruptMsgProc) { const Consensus::Params& consensusParams = Params().GetConsensus(); { diff --git a/src/net_processing.h b/src/net_processing.h index 7351c0e99c1..9e3f1b71566 100644 --- a/src/net_processing.h +++ b/src/net_processing.h @@ -49,7 +49,7 @@ bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats); void Misbehaving(NodeId nodeid, int howmuch); /** Process protocol messages received from a given node */ -bool ProcessMessages(CNode* pfrom, CConnman& connman, std::atomic& interrupt); +bool ProcessMessages(CNode* pfrom, CConnman& connman, const std::atomic& interrupt); /** * Send queued protocol messages to be sent to a give node. * @@ -58,6 +58,6 @@ bool ProcessMessages(CNode* pfrom, CConnman& connman, std::atomic& interru * @param[in] interrupt Interrupt condition for processing threads * @return True if there is more work to be done */ -bool SendMessages(CNode* pto, CConnman& connman, std::atomic& interrupt); +bool SendMessages(CNode* pto, CConnman& connman, const std::atomic& interrupt); #endif // BITCOIN_NET_PROCESSING_H