From 28a7d31565cb722e1a388743e2cbc492b6ad3bed Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Tue, 23 Apr 2019 11:07:44 +0000 Subject: p2p: do not send last_seen timestamp to peers This can be used for fingerprinting and working out the network topology. Instead of sending the first N (which are sorted by last seen time), we sent a random subset of the first N+N/5, which ensures reasonably recent peers are used, while preventing repeated calls from deducing new entries are peers the target node just connected to. The list is also randomly shuffled so the original set of timestamps cannot be approximated. --- src/p2p/net_node.inl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/p2p/net_node.inl') diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index be97edbe5..ba29d92c9 100644 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -1955,7 +1955,7 @@ namespace nodetool const epee::net_utils::zone zone_type = context.m_remote_address.get_zone(); network_zone& zone = m_network_zones.at(zone_type); - zone.m_peerlist.get_peerlist_head(rsp.local_peerlist_new); + zone.m_peerlist.get_peerlist_head(rsp.local_peerlist_new, true); m_payload_handler.get_payload_sync_data(rsp.payload_data); /* Tor/I2P nodes receiving connections via forwarding (from tor/i2p daemon) @@ -2058,7 +2058,7 @@ namespace nodetool }); //fill response - zone.m_peerlist.get_peerlist_head(rsp.local_peerlist_new); + zone.m_peerlist.get_peerlist_head(rsp.local_peerlist_new, true); get_local_node_data(rsp.node_data, zone); m_payload_handler.get_payload_sync_data(rsp.payload_data); LOG_DEBUG_CC(context, "COMMAND_HANDSHAKE"); -- cgit v1.2.3