aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGregory Maxwell <greg@xiph.org>2016-11-22 02:50:24 +0000
committerWladimir J. van der Laan <laanwj@gmail.com>2016-12-02 08:38:02 +0100
commitda5a16b11dca8f61d75f92bb08f1dd19a7800158 (patch)
tree98d5e62c3f0697fb340147e6ae13e905afae4eaf /src
parent094848baf01ae7f2ab8dbac4a625a8c956f2a760 (diff)
downloadbitcoin-da5a16b11dca8f61d75f92bb08f1dd19a7800158.tar.xz
Always drop the least preferred HB peer when adding a new one.
When a BIP152 HB-mode peer is in the least preferred position and disconnects, they will not be by ForNode on the next loop. They will continue to sit in that position and prevent deactivating HB mode for peers that are still connected. There is no reason for them to stay in the list if already gone, so drop the first element unconditionally if there are too many. Fixes issue #9163. Github-Pull: #9199 Rebased-From: ca8549d2bd32f17f8b69d1edbe3f2976fba504b4
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 191bcff4cc..6ad4304287 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -510,8 +510,8 @@ void MaybeSetPeerAsAnnouncingHeaderAndIDs(const CNodeState* nodestate, CNode* pf
CNode* pnodeStop = FindNode(lNodesAnnouncingHeaderAndIDs.front());
if (pnodeStop) {
pnodeStop->PushMessage(NetMsgType::SENDCMPCT, fAnnounceUsingCMPCTBLOCK, nCMPCTBLOCKVersion);
- lNodesAnnouncingHeaderAndIDs.pop_front();
}
+ lNodesAnnouncingHeaderAndIDs.pop_front();
}
fAnnounceUsingCMPCTBLOCK = true;
pfrom->PushMessage(NetMsgType::SENDCMPCT, fAnnounceUsingCMPCTBLOCK, nCMPCTBLOCKVersion);