#501 on_connection_closed - clear maps of connections
This commit is contained in:
parent
c421453621
commit
5203869a9d
1 changed files with 30 additions and 29 deletions
|
|
@ -3215,35 +3215,6 @@ namespace graphene { namespace net { namespace detail {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_closing_connections.erase(originating_peer_ptr);
|
|
||||||
_handshaking_connections.erase(originating_peer_ptr);
|
|
||||||
_terminating_connections.erase(originating_peer_ptr);
|
|
||||||
if (_active_connections.find(originating_peer_ptr) != _active_connections.end())
|
|
||||||
{
|
|
||||||
_active_connections.erase(originating_peer_ptr);
|
|
||||||
|
|
||||||
if (inbound_endpoint && originating_peer_ptr->get_remote_endpoint())
|
|
||||||
{
|
|
||||||
fc::optional<potential_peer_record> updated_peer_record = _potential_peer_db.lookup_entry_for_endpoint(*inbound_endpoint);
|
|
||||||
if (updated_peer_record)
|
|
||||||
{
|
|
||||||
updated_peer_record->last_seen_time = fc::time_point::now();
|
|
||||||
_potential_peer_db.update_entry(*updated_peer_record);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ilog("Remote peer ${endpoint} closed their connection to us", ("endpoint", originating_peer->get_remote_endpoint()));
|
|
||||||
display_current_connections();
|
|
||||||
trigger_p2p_network_connect_loop();
|
|
||||||
|
|
||||||
// notify the node delegate so it can update the display
|
|
||||||
if( _active_connections.size() != _last_reported_number_of_connections )
|
|
||||||
{
|
|
||||||
_last_reported_number_of_connections = (uint32_t)_active_connections.size();
|
|
||||||
_delegate->connection_count_changed( _last_reported_number_of_connections );
|
|
||||||
}
|
|
||||||
|
|
||||||
// if we had delegated a firewall check to this peer, send it to another peer
|
// if we had delegated a firewall check to this peer, send it to another peer
|
||||||
if (originating_peer->firewall_check_state)
|
if (originating_peer->firewall_check_state)
|
||||||
{
|
{
|
||||||
|
|
@ -3281,6 +3252,36 @@ namespace graphene { namespace net { namespace detail {
|
||||||
trigger_fetch_items_loop();
|
trigger_fetch_items_loop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_active_connections.find(originating_peer_ptr) != _active_connections.end())
|
||||||
|
{
|
||||||
|
_active_connections.erase(originating_peer_ptr);
|
||||||
|
|
||||||
|
if (inbound_endpoint && originating_peer_ptr->get_remote_endpoint())
|
||||||
|
{
|
||||||
|
fc::optional<potential_peer_record> updated_peer_record = _potential_peer_db.lookup_entry_for_endpoint(*inbound_endpoint);
|
||||||
|
if (updated_peer_record)
|
||||||
|
{
|
||||||
|
updated_peer_record->last_seen_time = fc::time_point::now();
|
||||||
|
_potential_peer_db.update_entry(*updated_peer_record);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// notify the node delegate so it can update the display
|
||||||
|
if( _active_connections.size() != _last_reported_number_of_connections )
|
||||||
|
{
|
||||||
|
_last_reported_number_of_connections = (uint32_t)_active_connections.size();
|
||||||
|
_delegate->connection_count_changed( _last_reported_number_of_connections );
|
||||||
|
}
|
||||||
|
|
||||||
|
_closing_connections.erase(originating_peer_ptr);
|
||||||
|
_handshaking_connections.erase(originating_peer_ptr);
|
||||||
|
_terminating_connections.erase(originating_peer_ptr);
|
||||||
|
|
||||||
|
ilog("Remote peer ${endpoint} closed their connection to us", ("endpoint", originating_peer->get_remote_endpoint()));
|
||||||
|
display_current_connections();
|
||||||
|
trigger_p2p_network_connect_loop();
|
||||||
|
|
||||||
schedule_peer_for_deletion(originating_peer_ptr);
|
schedule_peer_for_deletion(originating_peer_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue