Always drop the least preferred HB peer when adding a new one.
commitca8549d2bd32f17f8b69d1edbe3f2976fba504b4
authorGregory Maxwell <greg@xiph.org>
Tue, 22 Nov 2016 02:50:24 +0000 (22 02:50 +0000)
committerGregory Maxwell <greg@xiph.org>
Tue, 22 Nov 2016 02:54:32 +0000 (22 02:54 +0000)
tree91b35fd941534add9632bb65b5f96a57eca037c5
parent0c577f2638b7f701e4b4b96c4c8df39dc097cf2f
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.
src/main.cpp