aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_protocol/block_queue.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-08-16 19:27:16 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-08-16 22:24:50 +0100
commit7b747607566aa62460a4b4a278f2f8eb86f18bc2 (patch)
treeed20fdc58cd97a6b6ca3def513078608b87ff5f5 /src/cryptonote_protocol/block_queue.cpp
parentMerge pull request #2297 (diff)
downloadmonero-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 '')
-rw-r--r--src/cryptonote_protocol/block_queue.cpp10
1 files changed, 10 insertions, 0 deletions
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<boost::recursive_mutex> lock(mutex);