diff options
author | Alexander Blair <snipa@jagtech.io> | 2020-03-12 00:32:37 -0700 |
---|---|---|
committer | Alexander Blair <snipa@jagtech.io> | 2020-03-12 00:32:46 -0700 |
commit | 092a57df996be75e3a45e9dc69d15138093f503b (patch) | |
tree | be5f80d07b7e897772b71ac0037e7b81232b775b /src/p2p/net_peerlist.h | |
parent | Merge pull request #6248 (diff) | |
parent | p2p: remove obsolete local time in handshake (diff) | |
download | monero-092a57df996be75e3a45e9dc69d15138093f503b.tar.xz |
Merge pull request #6243
4771a7ae p2p: remove obsolete local time in handshake (moneromooo-monero)
2fbbc4a2 p2p: avoid sending the same peer list over and over (moneromooo-monero)
3004835b epee: remove backward compatible endian specific address serialization (moneromooo-monero)
39a343d7 p2p: remove backward compatible peer list (moneromooo-monero)
60631802 p2p: simplify last_seen serialization now we have optional stores (moneromooo-monero)
9467b2e4 cryptonote_protocol: omit top 64 bits of difficulty when 0 (moneromooo-monero)
b595583f serialization: do not write optional fields with default value (moneromooo-monero)
5f98b46d p2p: remove obsolete local time from TIMED_SYNC (moneromooo-monero)
Diffstat (limited to 'src/p2p/net_peerlist.h')
-rw-r--r-- | src/p2p/net_peerlist.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/p2p/net_peerlist.h b/src/p2p/net_peerlist.h index 58b704f73..8225ad2fa 100644 --- a/src/p2p/net_peerlist.h +++ b/src/p2p/net_peerlist.h @@ -269,19 +269,19 @@ namespace nodetool peers_indexed::index<by_time>::type& by_time_index=m_peers_white.get<by_time>(); uint32_t cnt = 0; - // picks a random set of peers within the first 120%, rather than a set of the first 100%. + // picks a random set of peers within the whole set, rather pick the first depth elements. // The intent is that if someone asks twice, they can't easily tell: // - this address was not in the first list, but is in the second, so the only way this can be // is if its last_seen was recently reset, so this means the target node recently had a new // connection to that address // - this address was in the first list, and not in the second, which means either the address - // was moved to the gray list (if it's not accessibe, which the attacker can check if + // was moved to the gray list (if it's not accessible, which the attacker can check if // the address accepts incoming connections) or it was the oldest to still fit in the 250 items, // so its last_seen is old. // // See Cao, Tong et al. "Exploring the Monero Peer-to-Peer Network". https://eprint.iacr.org/2019/411 // - const uint32_t pick_depth = anonymize ? depth + depth / 5 : depth; + const uint32_t pick_depth = anonymize ? m_peers_white.size() : depth; bs_head.reserve(pick_depth); for(const peers_indexed::value_type& vl: boost::adaptors::reverse(by_time_index)) { |