From 5be80b4b65e23fdd881de7faf2a8329ba121ea77 Mon Sep 17 00:00:00 2001 From: SergiySW Date: Mon, 28 Aug 2017 15:04:02 +0300 Subject: [PATCH 1/2] Initial Faucet & Landing accounts bootstrap --- rai/node/bootstrap.cpp | 15 +++++++++++---- rai/node/bootstrap.hpp | 2 ++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/rai/node/bootstrap.cpp b/rai/node/bootstrap.cpp index 9631632e..cbb10640 100755 --- a/rai/node/bootstrap.cpp +++ b/rai/node/bootstrap.cpp @@ -256,6 +256,8 @@ rai::frontier_req_client::frontier_req_client (std::shared_ptr node->store.environment, nullptr, false); @@ -279,8 +281,15 @@ void rai::frontier_req_client::receive_frontier () void rai::frontier_req_client::request_account (rai::account const & account_a, rai::block_hash const & latest_a) { - // Account they know about and we don't. - connection->attempt->pulls.push_back (rai::pull_info (account_a, latest_a, rai::block_hash (0))); + // Account they know about and we don't. + if (account_a != landing && account_a != faucet) + { + connection->attempt->pulls.push_back (rai::pull_info (account_a, latest_a, rai::block_hash (0))); + } + else + { + connection->attempt->pulls.push_front (rai::pull_info (account_a, latest_a, rai::block_hash (0))); + } } void rai::frontier_req_client::unsynced (MDB_txn * transaction_a, rai::block_hash const & ours_a, rai::block_hash const & theirs_a) @@ -348,8 +357,6 @@ void rai::frontier_req_client::received_frontier (boost::system::error_code cons else { // They know about a block we don't. - rai::account landing ("059F68AAB29DE0D3A27443625C7EA9CDDB6517A8B76FE37727EF6A4D76832AD5"); - rai::account faucet ("8E319CE6F3025E5B2DF66DA7AB1467FE48F1679C13DD43BFDB29FA2E9FC40D3B"); if (account != rai::genesis_account && account != landing && account != faucet) { connection->attempt->pulls.push_back (rai::pull_info (account, latest, info.head)); diff --git a/rai/node/bootstrap.hpp b/rai/node/bootstrap.hpp index 1b9fe7ea..21a9ab25 100644 --- a/rai/node/bootstrap.hpp +++ b/rai/node/bootstrap.hpp @@ -105,6 +105,8 @@ public: rai::account current; rai::account_info info; unsigned count; + rai::account landing; + rai::account faucet; std::chrono::system_clock::time_point next_report; std::promise promise; }; From d29f4f231e17e29bfa81c4a9f094330ab4b92047 Mon Sep 17 00:00:00 2001 From: SergiySW Date: Thu, 31 Aug 2017 12:28:34 +0300 Subject: [PATCH 2/2] Initial bootstrap predefined chains --- rai/node/bootstrap.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rai/node/bootstrap.cpp b/rai/node/bootstrap.cpp index cbb10640..b49496c8 100755 --- a/rai/node/bootstrap.cpp +++ b/rai/node/bootstrap.cpp @@ -282,7 +282,9 @@ void rai::frontier_req_client::receive_frontier () void rai::frontier_req_client::request_account (rai::account const & account_a, rai::block_hash const & latest_a) { // Account they know about and we don't. - if (account_a != landing && account_a != faucet) + rai::account account_1 ("6B31E80CABDD2FEE6F54A7BDBF91B666010418F4438EF0B48168F93CD79DBC85"); // xrb_1tsjx18cqqbhxsqobbxxqyauesi31iehaiwgy4ta4t9s9mdsuh671npo1st9 + rai::account account_2 ("FD6EE9E0E107A6A8584DB94A3F154799DD5C2A7D6ABED0889DA3B837B0E61663"); // xrb_3zdgx9ig43x8o3e6ugcc9wcnh8gxdio9ttoyt46buaxr8yrge7m5331qdwhk + if (account_a != landing && account_a != faucet && account_a != account_1 && account_a != account_2) { connection->attempt->pulls.push_back (rai::pull_info (account_a, latest_a, rai::block_hash (0))); }