From 7b747607566aa62460a4b4a278f2f8eb86f18bc2 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Wed, 16 Aug 2017 19:27:16 +0100 Subject: cryptonote_protocol: kick idle synchronizing peers In case they dropped off downloading for any reason, they'll get sent to download again. --- src/cryptonote_protocol/block_queue.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/cryptonote_protocol/block_queue.cpp') diff --git a/src/cryptonote_protocol/block_queue.cpp b/src/cryptonote_protocol/block_queue.cpp index 4f760582b..94d31404e 100644 --- a/src/cryptonote_protocol/block_queue.cpp +++ b/src/cryptonote_protocol/block_queue.cpp @@ -334,6 +334,16 @@ crypto::hash block_queue::get_last_known_hash(const boost::uuids::uuid &connecti return hash; } +bool block_queue::has_spans(const boost::uuids::uuid &connection_id) const +{ + for (const auto &span: blocks) + { + if (span.connection_id == connection_id) + return true; + } + return false; +} + float block_queue::get_speed(const boost::uuids::uuid &connection_id) const { boost::unique_lock lock(mutex); -- cgit v1.2.3