diff --git a/src/net_processing.cpp b/src/net_processing.cpp --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -497,29 +497,26 @@ } connman->ForNode(nodeid, [&connman](CNode *pfrom) { AssertLockHeld(cs_main); - bool fAnnounceUsingCMPCTBLOCK = false; uint64_t nCMPCTBLOCKVersion = 1; if (lNodesAnnouncingHeaderAndIDs.size() >= 3) { // As per BIP152, we only get 3 of our peers to announce // blocks using compact encodings. - connman->ForNode(lNodesAnnouncingHeaderAndIDs.front(), - [&connman, fAnnounceUsingCMPCTBLOCK, - nCMPCTBLOCKVersion](CNode *pnodeStop) { - AssertLockHeld(cs_main); - connman->PushMessage( - pnodeStop, - CNetMsgMaker(pnodeStop->GetSendVersion()) - .Make(NetMsgType::SENDCMPCT, - fAnnounceUsingCMPCTBLOCK, - nCMPCTBLOCKVersion)); - return true; - }); + connman->ForNode( + lNodesAnnouncingHeaderAndIDs.front(), + [&connman, nCMPCTBLOCKVersion](CNode *pnodeStop) { + AssertLockHeld(cs_main); + connman->PushMessage( + pnodeStop, CNetMsgMaker(pnodeStop->GetSendVersion()) + .Make(NetMsgType::SENDCMPCT, + /*fAnnounceUsingCMPCTBLOCK=*/false, + nCMPCTBLOCKVersion)); + return true; + }); lNodesAnnouncingHeaderAndIDs.pop_front(); } - fAnnounceUsingCMPCTBLOCK = true; connman->PushMessage(pfrom, CNetMsgMaker(pfrom->GetSendVersion()) .Make(NetMsgType::SENDCMPCT, - fAnnounceUsingCMPCTBLOCK, + /*fAnnounceUsingCMPCTBLOCK=*/true, nCMPCTBLOCKVersion)); lNodesAnnouncingHeaderAndIDs.push_back(pfrom->GetId()); return true;