Skip to content

Commit

Permalink
Bootstrap only from nodes that could be possibly up-to-date given vot…
Browse files Browse the repository at this point in the history
…e-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.
  • Loading branch information
cryptocode authored and rkeene committed Sep 19, 2018
1 parent c7a262e commit a94cb92
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rai/node/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 3 additions & 0 deletions rai/secure/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit a94cb92

Please sign in to comment.