aboutsummaryrefslogtreecommitdiff
path: root/src/p2p/net_node.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-12-04 21:22:55 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2020-01-29 14:39:56 +0000
commit2fbbc4a2d3ebfd6fca1d9d7687cef261491c0e1f (patch)
tree105e6c15cef7be8a535d571259fb294324d645f0 /src/p2p/net_node.h
parentepee: remove backward compatible endian specific address serialization (diff)
downloadmonero-2fbbc4a2d3ebfd6fca1d9d7687cef261491c0e1f.tar.xz
p2p: avoid sending the same peer list over and over
Nodes remember which connections have been sent which peer addresses and won't send it again. This causes more addresses to be sent as the connection lifetime grows, since there is no duplication anymore, which increases the diffusion speed of peer addresses. The whole white list is now considered for sending, not just the most recent seen peers. This further hardens against topology discovery, though it will more readily send peers that have been last seen earlier than it otherwise would. While this does save a fair amount of net bandwidth, it makes heavy use of std::set lookups, which does bring network_address::less up the profile, though not too aggressively.
Diffstat (limited to '')
-rw-r--r--src/p2p/net_node.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/p2p/net_node.h b/src/p2p/net_node.h
index 1ef6b9028..9b9ffbe2a 100644
--- a/src/p2p/net_node.h
+++ b/src/p2p/net_node.h
@@ -123,6 +123,7 @@ namespace nodetool
peerid_type peer_id;
uint32_t support_flags;
bool m_in_timedsync;
+ std::set<epee::net_utils::network_address> sent_addresses;
};
template<class t_payload_net_handler>