This builds on #11490 and is related to the work there, but I’ve separated this for review in order to not hold up #11490 (which I think is done).
This pr attempts to implement a strategy suggested by @gmaxwell, of choosing a peer for outbound eviction if our tip has not been updated in a while. I’d like to suggest this for consideration in 0.15.0.2 as well, as it is designed to mitigate p2p disruption in the event that all our outbound peers stop relaying blocks to us.
@theuni If you have a chance to review, I could use feedback on the first new commit here (Add hacky accessors for manipulating connman peers in tests
). I did the quickest thing I could in order to get a unit test working, but I’m pretty sure I violated all sorts of design goals, so I could use some guidance about the right way to add peers to connman in a unit test.