Bootstrap only from nodes that could be possibly up-to-date given vote-by-hash (#1184)

This will disable bootstrapping from nodes that are very likely out of date since they can only be updated during periodic bootstrapping, which is too slow.
This commit is contained in:
cryptocode 2018-09-19 16:18:18 +02:00 committed by Roy Keene
commit a94cb92903
2 changed files with 4 additions and 1 deletions

View file

@ -2123,7 +2123,7 @@ rai::endpoint rai::peer_container::bootstrap_peer ()
;
for (auto i (peers.get<4> ().begin ()), n (peers.get<4> ().end ()); i != n;)
{
if (i->network_version >= 0x5)
if (i->network_version >= protocol_version_bootstrap_min)
{
result = i->endpoint;
peers.get<4> ().modify (i, [](rai::peer_information & peer_a) {

View file

@ -29,6 +29,9 @@ const uint8_t protocol_version = 0x0f;
const uint8_t protocol_version_min = 0x07;
const uint8_t node_id_version = 0x0c;
/** Do not bootstrap from nodes older than this version */
const uint8_t protocol_version_bootstrap_min = 0x0d;
/**
* A key pair. The private key is generated from the random pool, or passed in
* as a hex string. The public key is derived using ed25519.