diff options
| author | Suhas Daftuar <[email protected]> | 2017-10-24 16:56:07 -0400 |
|---|---|---|
| committer | Suhas Daftuar <[email protected]> | 2017-11-02 12:39:14 -0400 |
| commit | ac7b37cd2bd612a64a4009ba82f1cd1d57f37434 (patch) | |
| tree | cd7e7a674a9de4e5d93fea61c869fb7a03180725 /src/init.cpp | |
| parent | Track tip update time and last new block announcement from each peer (diff) | |
| download | discoin-ac7b37cd2bd612a64a4009ba82f1cd1d57f37434.tar.xz discoin-ac7b37cd2bd612a64a4009ba82f1cd1d57f37434.zip | |
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).
Diffstat (limited to 'src/init.cpp')
| -rw-r--r-- | src/init.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp index 655743488..e57ea0f43 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1270,7 +1270,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) g_connman = std::unique_ptr<CConnman>(new CConnman(GetRand(std::numeric_limits<uint64_t>::max()), GetRand(std::numeric_limits<uint64_t>::max()))); CConnman& connman = *g_connman; - peerLogic.reset(new PeerLogicValidation(&connman)); + peerLogic.reset(new PeerLogicValidation(&connman, scheduler)); RegisterValidationInterface(peerLogic.get()); // sanitize comments per BIP-0014, format user agent and check total size |