mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Connect to an extra outbound peer if our tip is stale
If our tip hasn't updated in a while, that may be because our peers are not relaying blocks to us that we would consider valid. Allow connection to an additional outbound peer in that circumstance. Also, periodically check to see if we are exceeding our target number of outbound peers, and disconnect the one which has least recently announced a new block to us (choosing the newest such peer in the case of tie).
This commit is contained in:
@@ -86,7 +86,7 @@ TestingSetup::TestingSetup(const std::string& chainName) : BasicTestingSetup(cha
|
||||
threadGroup.create_thread(&ThreadScriptCheck);
|
||||
g_connman = std::unique_ptr<CConnman>(new CConnman(0x1337, 0x1337)); // Deterministic randomness for tests.
|
||||
connman = g_connman.get();
|
||||
peerLogic.reset(new PeerLogicValidation(connman));
|
||||
peerLogic.reset(new PeerLogicValidation(connman, scheduler));
|
||||
}
|
||||
|
||||
TestingSetup::~TestingSetup()
|
||||
|
||||
Reference in New Issue
Block a user