cryptonote_protocol: kick idle synchronizing peers

In case they dropped off downloading for any reason, they'll get
sent to download again.
This commit is contained in:
moneromooo-monero 2017-08-16 19:27:16 +01:00
parent d0a610183a
commit 7b74760756
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
5 changed files with 44 additions and 0 deletions

View file

@ -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);