aboutsummaryrefslogtreecommitdiff
path: root/src/p2p/net_node.inl
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-07-04 21:44:28 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-07-04 21:56:10 +0000
commitab361df2cd59f9c1e62954fb6ab64701591ff70b (patch)
tree3d929601ee7bd61dda928c509c8a07779c3cabe7 /src/p2p/net_node.inl
parentMerge pull request #5663 (diff)
downloadmonero-ab361df2cd59f9c1e62954fb6ab64701591ff70b.tar.xz
p2p: add a few missing connection close calls
Diffstat (limited to '')
-rw-r--r--src/p2p/net_node.inl8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl
index ba29d92c9..60d43ba99 100644
--- a/src/p2p/net_node.inl
+++ b/src/p2p/net_node.inl
@@ -944,7 +944,10 @@ namespace nodetool
}
if(!context.m_is_income)
m_network_zones.at(context.m_remote_address.get_zone()).m_peerlist.set_peer_just_seen(context.peer_id, context.m_remote_address, context.m_pruning_seed, context.m_rpc_port);
- m_payload_handler.process_payload_sync_data(rsp.payload_data, context, false);
+ if (!m_payload_handler.process_payload_sync_data(rsp.payload_data, context, false))
+ {
+ m_network_zones.at(context.m_remote_address.get_zone()).m_net_server.get_config_object().close(context.m_connection_id );
+ }
});
if(!r)
@@ -1090,6 +1093,7 @@ namespace nodetool
LOG_PRINT_CC_PRIORITY_NODE(is_priority, *con, "Failed to HANDSHAKE with peer "
<< na.str()
/*<< ", try " << try_count*/);
+ zone.m_net_server.get_config_object().close(con->m_connection_id);
return false;
}
@@ -1149,7 +1153,7 @@ namespace nodetool
bool is_priority = is_priority_node(na);
LOG_PRINT_CC_PRIORITY_NODE(is_priority, *con, "Failed to HANDSHAKE with peer " << na.str());
-
+ zone.m_net_server.get_config_object().close(con->m_connection_id);
return false;
}