Sending keepalive to all bootstrap nodes every keepalive for more aggressive assurance of connectivity.

This commit is contained in:
clemahieu 2014-12-05 20:35:01 -06:00
commit 61bafd41f8
5 changed files with 5 additions and 3 deletions

View file

@ -115,7 +115,7 @@ void rai_daemon::daemon::run ()
auto client (std::make_shared <rai::client> (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)

View file

@ -2907,6 +2907,7 @@ void rai::peer_container::random_fill (std::array <rai::endpoint, 8> & 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)
{

View file

@ -693,6 +693,7 @@ namespace rai {
std::vector <std::function <void (rai::receive_block const &, rai::account const &, rai::amount const &)>> receive_observers;
std::vector <std::function <void (rai::open_block const &, rai::account const &, rai::amount const &, rai::account const &)>> open_observers;
std::vector <std::function <void (rai::change_block const &, rai::account const &, rai::account const &)>> change_observers;
std::vector <std::string> bootstrap_peers;
};
class system
{

View file

@ -180,7 +180,7 @@ int main ()
auto client (std::make_shared <rai::client> (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] ()
{

View file

@ -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 <rai_qt::client> gui (new rai_qt::client (application, *client));
gui->client_window->show ();