diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-08-16 19:27:16 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-08-16 22:24:50 +0100 |
commit | 7b747607566aa62460a4b4a278f2f8eb86f18bc2 (patch) | |
tree | ed20fdc58cd97a6b6ca3def513078608b87ff5f5 /src/cryptonote_protocol/cryptonote_protocol_handler.h | |
parent | Merge pull request #2297 (diff) | |
download | monero-7b747607566aa62460a4b4a278f2f8eb86f18bc2.tar.xz |
cryptonote_protocol: kick idle synchronizing peers
In case they dropped off downloading for any reason, they'll get
sent to download again.
Diffstat (limited to 'src/cryptonote_protocol/cryptonote_protocol_handler.h')
-rw-r--r-- | src/cryptonote_protocol/cryptonote_protocol_handler.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.h b/src/cryptonote_protocol/cryptonote_protocol_handler.h index f30aebf3a..d94747769 100644 --- a/src/cryptonote_protocol/cryptonote_protocol_handler.h +++ b/src/cryptonote_protocol/cryptonote_protocol_handler.h @@ -38,6 +38,7 @@ #include <string> #include <ctime> +#include "math_helper.h" #include "storages/levin_abstract_invoke2.h" #include "warnings.h" #include "cryptonote_protocol_defs.h" @@ -131,6 +132,7 @@ namespace cryptonote bool on_connection_synchronized(); bool should_download_next_span(cryptonote_connection_context& context) const; void drop_connection(cryptonote_connection_context &context, bool add_fail, bool flush_all_spans); + bool kick_idle_peers(); t_core& m_core; @@ -141,6 +143,7 @@ namespace cryptonote std::atomic<bool> m_stopping; boost::mutex m_sync_lock; block_queue m_block_queue; + epee::math_helper::once_a_time_seconds<30> m_idle_peer_kicker; boost::mutex m_buffer_mutex; double get_avg_block_size(); |