Revert "fix accessing an network address in a deleted context"

This reverts commit 4e74385a1a.
This commit is contained in:
selsta 2021-01-12 12:18:23 +01:00
parent 964ad0e51a
commit 76fe73b8bd
No known key found for this signature in database
GPG key ID: 2EA0A99A8B07AE5E
2 changed files with 9 additions and 15 deletions

View file

@ -2840,15 +2840,12 @@ skip:
epee::string_tools::to_string_hex(context.m_pruning_seed) <<
"), score " << score << ", flush_all_spans " << flush_all_spans);
if (score > 0)
m_p2p->add_host_fail(context.m_remote_address, score);
m_block_queue.flush_spans(context.m_connection_id, flush_all_spans);
// copy since dropping the connection will invalidate the context, and thus the address
const auto remote_address = context.m_remote_address;
m_p2p->drop_connection(context);
if (score > 0)
m_p2p->add_host_fail(remote_address, score);
}
//------------------------------------------------------------------------------------------------------------------------
template<class t_core>