Merge #11560: Connect to a new outbound peer if our tip is stale
commit2f959a58744d42859d74579220922e25ac3d2925
authorWladimir J. van der Laan <laanwj@gmail.com>
Thu, 2 Nov 2017 19:13:17 +0000 (2 20:13 +0100)
committerWladimir J. van der Laan <laanwj@gmail.com>
Thu, 2 Nov 2017 19:13:24 +0000 (2 20:13 +0100)
tree5b29d3325690b3b390e09ed05799e014a7e2affd
parent7008b07005c50ca2865ead36f5b3cee0c8d1bacc
parent626291508c433488439b662f2e88882048fb59fb
Merge #11560: Connect to a new outbound peer if our tip is stale

6262915 Add unit test for stale tip checking (Suhas Daftuar)
83df257 Add CConnmanTest to mutate g_connman in tests (João Barbosa)
ac7b37c Connect to an extra outbound peer if our tip is stale (Suhas Daftuar)
db32a65 Track tip update time and last new block announcement from each peer (Suhas Daftuar)
2d4327d net: Allow connecting to extra outbound peers (Suhas Daftuar)

Pull request description:

  This is an alternative approach to #11534.  Rather than disconnect an outbound peer when our tip looks stale, instead try to connect to an additional outbound peer.

  Periodically, check to see if we have more outbound peers than we target (ie if any extra peers are in use), and if so, disconnect the one that least recently announced a new block (breaking ties by choosing the newest peer that we connected to).

Tree-SHA512: 8f19e910e0bb36867f81783e020af225f356451899adfc7ade1895d6d3bd5afe51c83759610dfd10c62090c4fe404efa0283b2f63fde0bd7da898a1aaa7fb281
src/net_processing.cpp