@@ -778,7 +778,7 @@ static uint256 most_recent_block_hash;
778778
779779void PeerLogicValidation::NewPoWValidBlock (const CBlockIndex *pindex, const std::shared_ptr<const CBlock>& pblock) {
780780 std::shared_ptr<const CBlockHeaderAndShortTxIDs> pcmpctblock = std::make_shared<const CBlockHeaderAndShortTxIDs> (*pblock, true );
781- CNetMsgMaker msgMaker (PROTOCOL_VERSION);
781+ const CNetMsgMaker msgMaker (PROTOCOL_VERSION);
782782
783783 LOCK (cs_main);
784784
@@ -960,7 +960,7 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam
960960{
961961 std::deque<CInv>::iterator it = pfrom->vRecvGetData .begin ();
962962 std::vector<CInv> vNotFound;
963- CNetMsgMaker msgMaker (pfrom->GetSendVersion ());
963+ const CNetMsgMaker msgMaker (pfrom->GetSendVersion ());
964964 LOCK (cs_main);
965965
966966 while (it != pfrom->vRecvGetData .end ()) {
@@ -1153,7 +1153,7 @@ inline void static SendBlockTransactions(const CBlock& block, const BlockTransac
11531153 resp.txn [i] = block.vtx [req.indexes [i]];
11541154 }
11551155 LOCK (cs_main);
1156- CNetMsgMaker msgMaker (pfrom->GetSendVersion ());
1156+ const CNetMsgMaker msgMaker (pfrom->GetSendVersion ());
11571157 int nSendFlags = State (pfrom->GetId ())->fWantsCmpctWitness ? 0 : SERIALIZE_TRANSACTION_NO_WITNESS;
11581158 connman.PushMessage (pfrom, msgMaker.Make (nSendFlags, NetMsgType::BLOCKTXN, resp));
11591159}
@@ -1346,7 +1346,7 @@ bool static ProcessMessage(CNode* pfrom, std::string strCommand, CDataStream& vR
13461346 }
13471347
13481348 // At this point, the outgoing message serialization version can't change.
1349- CNetMsgMaker msgMaker (pfrom->GetSendVersion ());
1349+ const CNetMsgMaker msgMaker (pfrom->GetSendVersion ());
13501350
13511351 if (strCommand == NetMsgType::VERACK)
13521352 {
@@ -2721,7 +2721,7 @@ bool SendMessages(CNode* pto, CConnman& connman, std::atomic<bool>& interruptMsg
27212721 return true ;
27222722
27232723 // If we get here, the outgoing message serialization version is set and can't change.
2724- CNetMsgMaker msgMaker (pto->GetSendVersion ());
2724+ const CNetMsgMaker msgMaker (pto->GetSendVersion ());
27252725
27262726 //
27272727 // Message: ping
0 commit comments