aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_protocol
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2021-03-29 21:08:03 -0400
committerluigi1111 <luigi1111w@gmail.com>2021-03-29 21:08:03 -0400
commit8c8197463feafc35eb8dda7ec962b8b3c6bfba5c (patch)
tree3bf97a08a43f32053cdc1c50af22f158dcf009cd /src/cryptonote_protocol
parent1cd1206332ae39e50944ca2c022fdb29323952af (diff)
parent76fe73b8bd19b49a7354157b6b7efbeee900d8a8 (diff)
downloadmonzero-core-8c8197463feafc35eb8dda7ec962b8b3c6bfba5c.tar.gz
monzero-core-8c8197463feafc35eb8dda7ec962b8b3c6bfba5c.tar.xz
monzero-core-8c8197463feafc35eb8dda7ec962b8b3c6bfba5c.zip
Merge pull request #7310
76fe73b Revert 'fix accessing an network address in a deleted context' (selsta)
Diffstat (limited to 'src/cryptonote_protocol')
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler.inl9
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 c798dbcdb..5580998fb 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>