diff options
author | selsta <selsta@sent.at> | 2021-01-12 12:18:23 +0100 |
---|---|---|
committer | selsta <selsta@sent.at> | 2021-01-12 12:18:23 +0100 |
commit | 76fe73b8bd19b49a7354157b6b7efbeee900d8a8 (patch) | |
tree | dab40b6a5f0b8ac0e7ad51f71b93f755a40d4613 /src/cryptonote_protocol/cryptonote_protocol_handler.inl | |
parent | Merge pull request #7286 (diff) | |
download | monero-76fe73b8bd19b49a7354157b6b7efbeee900d8a8.tar.xz |
Revert "fix accessing an network address in a deleted context"
This reverts commit 4e74385a1ae9eae4ae9e8d155dfd96978eb10e7a.
Diffstat (limited to '')
-rw-r--r-- | src/cryptonote_protocol/cryptonote_protocol_handler.inl | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl index cfd4a1596..e69e5673c 100644 --- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl +++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl @@ -2840,15 +2840,12 @@ skip: epee::string_tools::to_string_hex(context.m_pruning_seed) << "), score " << score << ", flush_all_spans " << flush_all_spans); - m_block_queue.flush_spans(context.m_connection_id, flush_all_spans); + if (score > 0) + m_p2p->add_host_fail(context.m_remote_address, score); - // copy since dropping the connection will invalidate the context, and thus the address - const auto remote_address = context.m_remote_address; + m_block_queue.flush_spans(context.m_connection_id, flush_all_spans); m_p2p->drop_connection(context); - - if (score > 0) - m_p2p->add_host_fail(remote_address, score); } //------------------------------------------------------------------------------------------------------------------------ template<class t_core> |