Skip to content

Commit 407d923

Browse files
committed
Merge #9199: Always drop the least preferred HB peer when adding a new one.
ca8549d Always drop the least preferred HB peer when adding a new one. (Gregory Maxwell)
2 parents 0de7fd3 + ca8549d commit 407d923

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/main.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,12 +529,11 @@ void MaybeSetPeerAsAnnouncingHeaderAndIDs(const CNodeState* nodestate, CNode* pf
529529
if (lNodesAnnouncingHeaderAndIDs.size() >= 3) {
530530
// As per BIP152, we only get 3 of our peers to announce
531531
// blocks using compact encodings.
532-
bool found = connman.ForNode(lNodesAnnouncingHeaderAndIDs.front(), [&connman, fAnnounceUsingCMPCTBLOCK, nCMPCTBLOCKVersion](CNode* pnodeStop){
532+
connman.ForNode(lNodesAnnouncingHeaderAndIDs.front(), [&connman, fAnnounceUsingCMPCTBLOCK, nCMPCTBLOCKVersion](CNode* pnodeStop){
533533
connman.PushMessage(pnodeStop, NetMsgType::SENDCMPCT, fAnnounceUsingCMPCTBLOCK, nCMPCTBLOCKVersion);
534534
return true;
535535
});
536-
if(found)
537-
lNodesAnnouncingHeaderAndIDs.pop_front();
536+
lNodesAnnouncingHeaderAndIDs.pop_front();
538537
}
539538
fAnnounceUsingCMPCTBLOCK = true;
540539
connman.PushMessage(pfrom, NetMsgType::SENDCMPCT, fAnnounceUsingCMPCTBLOCK, nCMPCTBLOCKVersion);

0 commit comments

Comments
 (0)