mirror of
https://github.com/monero-project/monero.git
synced 2025-08-18 14:27:56 -04:00
cryptonote_protocol: retry stale spans early
Connections can be dropped by the net_node layer, unbeknownst to cryptonote_protocol, which would then not flush any spans scheduled to that connection, which would cause it to be only downloaded again once it becomes the next span (possibly after a small delay if it had been requested less than 5 seconds ago).
This commit is contained in:
parent
90df52e12f
commit
f57ee382b8
3 changed files with 25 additions and 0 deletions
|
@ -1189,6 +1189,14 @@ skip:
|
|||
{
|
||||
m_block_queue.mark_last_block(m_core.get_current_blockchain_height() - 1);
|
||||
|
||||
// flush stale spans
|
||||
std::set<boost::uuids::uuid> live_connections;
|
||||
m_p2p->for_each_connection([&](cryptonote_connection_context& context, nodetool::peerid_type peer_id, uint32_t support_flags)->bool{
|
||||
live_connections.insert(context.m_connection_id);
|
||||
return true;
|
||||
});
|
||||
m_block_queue.flush_stale_spans(live_connections);
|
||||
|
||||
// if we don't need to get next span, and the block queue is full enough, wait a bit
|
||||
bool start_from_current_chain = false;
|
||||
if (!force_next_span)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue