From 61bafd41f88c19dcc5aaa7d2cd472fd07682318d Mon Sep 17 00:00:00 2001 From: clemahieu Date: Fri, 5 Dec 2014 20:35:01 -0600 Subject: [PATCH] Sending keepalive to all bootstrap nodes every keepalive for more aggressive assurance of connectivity. --- rai/cli/daemon.cpp | 2 +- rai/core/core.cpp | 1 + rai/core/core.hpp | 1 + rai/landing/entry.cpp | 2 +- rai/qt_client/entry.cpp | 2 +- 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/rai/cli/daemon.cpp b/rai/cli/daemon.cpp index 7d7f28aa..7e04c171 100644 --- a/rai/cli/daemon.cpp +++ b/rai/cli/daemon.cpp @@ -115,7 +115,7 @@ void rai_daemon::daemon::run () auto client (std::make_shared (init, service, config.peering_port, working / "data", processor, config.representative)); if (!init.error ()) { - client->processor.connect_bootstrap (config.bootstrap_peers); + client->bootstrap_peers = config.bootstrap_peers; client->start (); rai::rpc rpc (service, pool, config.rpc_address, config.rpc_port, *client, config.rpc_enable_control); if (config.rpc_enable) diff --git a/rai/core/core.cpp b/rai/core/core.cpp index c629a67c..fb1774a2 100644 --- a/rai/core/core.cpp +++ b/rai/core/core.cpp @@ -2907,6 +2907,7 @@ void rai::peer_container::random_fill (std::array & target_a) void rai::processor::ongoing_keepalive () { + connect_bootstrap (client.bootstrap_peers); auto peers (client.peers.purge_list (std::chrono::system_clock::now () - cutoff)); for (auto i (peers.begin ()), j (peers.end ()); i != j && std::chrono::system_clock::now () - i->last_attempt > period; ++i) { diff --git a/rai/core/core.hpp b/rai/core/core.hpp index 4a3aeaed..7be76674 100644 --- a/rai/core/core.hpp +++ b/rai/core/core.hpp @@ -693,6 +693,7 @@ namespace rai { std::vector > receive_observers; std::vector > open_observers; std::vector > change_observers; + std::vector bootstrap_peers; }; class system { diff --git a/rai/landing/entry.cpp b/rai/landing/entry.cpp index 4dd5ace7..a1d79b94 100644 --- a/rai/landing/entry.cpp +++ b/rai/landing/entry.cpp @@ -180,7 +180,7 @@ int main () auto client (std::make_shared (init, service, config.peering_port, working, processor, rai::genesis_account)); if (!init.error ()) { - client->processor.connect_bootstrap (config.bootstrap_peers); + client->bootstrap_peers = config.bootstrap_peers; client->start (); std::thread network_thread ([&service] () { diff --git a/rai/qt_client/entry.cpp b/rai/qt_client/entry.cpp index da36920f..59db1bee 100644 --- a/rai/qt_client/entry.cpp +++ b/rai/qt_client/entry.cpp @@ -103,7 +103,7 @@ int main (int argc, char ** argv) }); if (!init.error ()) { - client->processor.connect_bootstrap (config.bootstrap_peers); + client->bootstrap_peers = config.bootstrap_peers; client->start (); std::unique_ptr gui (new rai_qt::client (application, *client)); gui->client_window->show ();