mirror of
https://github.com/wownero/wownero.git
synced 2026-10-17 07:31:35 +02:00
protocol: flush rejected block spans from disconnected peers
(cherry picked from commit dfa2d3020be5cc6dcd4a525bc1b7a315b9e83f57)
This commit is contained in:
@@ -1478,6 +1478,7 @@ namespace cryptonote
|
||||
if (!m_core.prepare_handle_incoming_blocks(blocks, pblocks))
|
||||
{
|
||||
LOG_ERROR_CCONTEXT("Failure in prepare_handle_incoming_blocks");
|
||||
m_block_queue.flush_spans(span_connection_id, true);
|
||||
drop_connections(span_origin);
|
||||
return 1;
|
||||
}
|
||||
@@ -2825,6 +2826,7 @@ skip:
|
||||
template<class t_core>
|
||||
void t_cryptonote_protocol_handler<t_core>::drop_connection(const boost::uuids::uuid& id)
|
||||
{
|
||||
m_block_queue.flush_spans(id, true);
|
||||
m_p2p->for_connection(id, [this](cryptonote_connection_context& context, nodetool::peerid_type peer_id, uint32_t f)->bool{
|
||||
// This _could be_ outside of strand, so careful on actions
|
||||
drop_connection(context, true, false);
|
||||
|
||||
Reference in New Issue
Block a user