Skip to content

Commit fa9f455

Browse files
author
MarcoFalke
committed
refactor: Remove pointless and confusing shift in RelayAddress
1 parent 53b0450 commit fa9f455

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/net_processing.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,8 +1746,8 @@ void PeerManagerImpl::RelayAddress(NodeId originator,
17461746
// Relay to a limited number of other nodes
17471747
// Use deterministic randomness to send to the same nodes for 24 hours
17481748
// at a time so the m_addr_knowns of the chosen nodes prevent repeats
1749-
uint64_t hashAddr = addr.GetHash();
1750-
const CSipHasher hasher = m_connman.GetDeterministicRandomizer(RANDOMIZER_ID_ADDRESS_RELAY).Write(hashAddr << 32).Write((GetTime() + hashAddr) / (24 * 60 * 60));
1749+
const uint64_t hashAddr{addr.GetHash()};
1750+
const CSipHasher hasher{m_connman.GetDeterministicRandomizer(RANDOMIZER_ID_ADDRESS_RELAY).Write(hashAddr).Write((GetTime() + hashAddr) / (24 * 60 * 60))};
17511751
FastRandomContext insecure_rand;
17521752

17531753
// Relay reachable addresses to 2 peers. Unreachable addresses are relayed randomly to 1 or 2 peers.

test/sanitizer_suppressions/ubsan

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,5 @@ implicit-unsigned-integer-truncation:crypto/
105105
shift-base:arith_uint256.cpp
106106
shift-base:crypto/
107107
shift-base:hash.cpp
108-
shift-base:net_processing.cpp
109108
shift-base:streams.h
110109
shift-base:util/bip32.cpp

0 commit comments

Comments
 (0)