@@ -371,19 +371,17 @@ void MaybeSetPeerAsAnnouncingHeaderAndIDs(NodeId nodeid, CConnman* connman) {
371
371
}
372
372
}
373
373
connman->ForNode (nodeid, [connman](CNode* pfrom){
374
- bool fAnnounceUsingCMPCTBLOCK = false ;
375
374
uint64_t nCMPCTBLOCKVersion = (pfrom->GetLocalServices () & NODE_WITNESS) ? 2 : 1 ;
376
375
if (lNodesAnnouncingHeaderAndIDs.size () >= 3 ) {
377
376
// As per BIP152, we only get 3 of our peers to announce
378
377
// blocks using compact encodings.
379
- connman->ForNode (lNodesAnnouncingHeaderAndIDs.front (), [connman, fAnnounceUsingCMPCTBLOCK , nCMPCTBLOCKVersion](CNode* pnodeStop){
380
- connman->PushMessage (pnodeStop, CNetMsgMaker (pnodeStop->GetSendVersion ()).Make (NetMsgType::SENDCMPCT, fAnnounceUsingCMPCTBLOCK , nCMPCTBLOCKVersion));
378
+ connman->ForNode (lNodesAnnouncingHeaderAndIDs.front (), [connman, nCMPCTBLOCKVersion](CNode* pnodeStop){
379
+ connman->PushMessage (pnodeStop, CNetMsgMaker (pnodeStop->GetSendVersion ()).Make (NetMsgType::SENDCMPCT, /* fAnnounceUsingCMPCTBLOCK= */ false , nCMPCTBLOCKVersion));
381
380
return true ;
382
381
});
383
382
lNodesAnnouncingHeaderAndIDs.pop_front ();
384
383
}
385
- fAnnounceUsingCMPCTBLOCK = true ;
386
- connman->PushMessage (pfrom, CNetMsgMaker (pfrom->GetSendVersion ()).Make (NetMsgType::SENDCMPCT, fAnnounceUsingCMPCTBLOCK , nCMPCTBLOCKVersion));
384
+ connman->PushMessage (pfrom, CNetMsgMaker (pfrom->GetSendVersion ()).Make (NetMsgType::SENDCMPCT, /* fAnnounceUsingCMPCTBLOCK=*/ true , nCMPCTBLOCKVersion));
387
385
lNodesAnnouncingHeaderAndIDs.push_back (pfrom->GetId ());
388
386
return true ;
389
387
});
0 commit comments