From 5f98b46d58e37dfe409578d48e15966acf7c4560 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Wed, 4 Dec 2019 12:51:45 +0000 Subject: [PATCH] p2p: remove obsolete local time from TIMED_SYNC --- src/p2p/net_node.h | 2 +- src/p2p/net_node.inl | 8 +++----- src/p2p/p2p_protocol_defs.h | 2 -- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/p2p/net_node.h b/src/p2p/net_node.h index 0e9c1c942..1ef6b9028 100644 --- a/src/p2p/net_node.h +++ b/src/p2p/net_node.h @@ -362,7 +362,7 @@ namespace nodetool const boost::program_options::variables_map& vm ); bool idle_worker(); - bool handle_remote_peerlist(const std::vector& peerlist, time_t local_time, const epee::net_utils::connection_context_base& context); + bool handle_remote_peerlist(const std::vector& peerlist, const epee::net_utils::connection_context_base& context); bool get_local_node_data(basic_node_data& node_data, const network_zone& zone); //bool get_local_handshake_data(handshake_data& hshd); diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index 263cecfa2..7a2feddc8 100644 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -1041,7 +1041,7 @@ namespace nodetool return; } - if(!handle_remote_peerlist(rsp.local_peerlist_new, rsp.node_data.local_time, context)) + if(!handle_remote_peerlist(rsp.local_peerlist_new, context)) { LOG_WARNING_CC(context, "COMMAND_HANDSHAKE: failed to handle_remote_peerlist(...), closing connection."); add_host_fail(context.m_remote_address); @@ -1119,7 +1119,7 @@ namespace nodetool return; } - if(!handle_remote_peerlist(rsp.local_peerlist_new, rsp.local_time, context)) + if(!handle_remote_peerlist(rsp.local_peerlist_new, context)) { LOG_WARNING_CC(context, "COMMAND_TIMED_SYNC: failed to handle_remote_peerlist(...), closing connection."); m_network_zones.at(context.m_remote_address.get_zone()).m_net_server.get_config_object().close(context.m_connection_id ); @@ -1894,7 +1894,7 @@ namespace nodetool } //----------------------------------------------------------------------------------- template - bool node_server::handle_remote_peerlist(const std::vector& peerlist, time_t local_time, const epee::net_utils::connection_context_base& context) + bool node_server::handle_remote_peerlist(const std::vector& peerlist, const epee::net_utils::connection_context_base& context) { std::vector peerlist_ = peerlist; if(!sanitize_peerlist(peerlist_)) @@ -2291,8 +2291,6 @@ namespace nodetool } //fill response - rsp.local_time = time(NULL); - const epee::net_utils::zone zone_type = context.m_remote_address.get_zone(); network_zone& zone = m_network_zones.at(zone_type); diff --git a/src/p2p/p2p_protocol_defs.h b/src/p2p/p2p_protocol_defs.h index 44b278589..178382547 100644 --- a/src/p2p/p2p_protocol_defs.h +++ b/src/p2p/p2p_protocol_defs.h @@ -268,12 +268,10 @@ namespace nodetool struct response_t { - uint64_t local_time; t_playload_type payload_data; std::vector local_peerlist_new; BEGIN_KV_SERIALIZE_MAP() - KV_SERIALIZE(local_time) KV_SERIALIZE(payload_data) if (is_store) {