diff options
author | luigi1111 <luigi1111w@gmail.com> | 2021-10-11 12:55:31 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2021-10-11 12:55:31 -0500 |
commit | 6f2ebee8ff13b0260548f0fe92cbd571ec89d9ef (patch) | |
tree | 46754f2ee20cdc798c4ff25ee8d4b5661c5a54d2 /src/p2p/net_node.inl | |
parent | Merge pull request #7985 (diff) | |
parent | node_server: fix race condition (diff) | |
download | monero-6f2ebee8ff13b0260548f0fe92cbd571ec89d9ef.tar.xz |
Merge pull request #7873
d4c7549 node_server: fix race condition (anon)
2909bd1 node_server: add race condition demo (anon)
Diffstat (limited to 'src/p2p/net_node.inl')
-rw-r--r-- | src/p2p/net_node.inl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index b8cf2d124..438b8ca11 100644 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -1432,6 +1432,7 @@ namespace nodetool ape.first_seen = first_seen_stamp ? first_seen_stamp : time(nullptr); zone.m_peerlist.append_with_peer_anchor(ape); + zone.m_notifier.on_handshake_complete(con->m_connection_id, con->m_is_income); zone.m_notifier.new_out_connection(); LOG_DEBUG_CC(*con, "CONNECTION HANDSHAKED OK."); @@ -2559,6 +2560,8 @@ namespace nodetool return 1; } + zone.m_notifier.on_handshake_complete(context.m_connection_id, context.m_is_income); + if(has_too_many_connections(context.m_remote_address)) { LOG_PRINT_CCONTEXT_L1("CONNECTION FROM " << context.m_remote_address.host_str() << " REFUSED, too many connections from the same address"); @@ -2683,6 +2686,9 @@ namespace nodetool zone.m_peerlist.remove_from_peer_anchor(na); } + if (!zone.m_net_server.is_stop_signal_sent()) { + zone.m_notifier.on_connection_close(context.m_connection_id); + } m_payload_handler.on_connection_close(context); MINFO("["<< epee::net_utils::print_connection_context(context) << "] CLOSE CONNECTION"); |