Skip to content

Commit 4971a9a

Browse files
Use two boolean literals instead of re-using variable
1 parent b5fb339 commit 4971a9a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/net_processing.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -371,19 +371,17 @@ void MaybeSetPeerAsAnnouncingHeaderAndIDs(NodeId nodeid, CConnman* connman) {
371371
}
372372
}
373373
connman->ForNode(nodeid, [connman](CNode* pfrom){
374-
bool fAnnounceUsingCMPCTBLOCK = false;
375374
uint64_t nCMPCTBLOCKVersion = (pfrom->GetLocalServices() & NODE_WITNESS) ? 2 : 1;
376375
if (lNodesAnnouncingHeaderAndIDs.size() >= 3) {
377376
// As per BIP152, we only get 3 of our peers to announce
378377
// 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));
381380
return true;
382381
});
383382
lNodesAnnouncingHeaderAndIDs.pop_front();
384383
}
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));
387385
lNodesAnnouncingHeaderAndIDs.push_back(pfrom->GetId());
388386
return true;
389387
});

0 commit comments

Comments
 (0)