mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Merge bitcoin/bitcoin#23970: Remove pointless and confusing shift in RelayAddress
fa9f4554carefactor: Remove pointless and confusing shift in RelayAddress (MarcoFalke) Pull request description: The second argument written to the siphash is already quantized to 24 hours, so it seems confusing to quantize the first argument to 32 bits (out of 64 bits). > The shifting is pointless, we should get rid of it. It seems to be a silly evolution of this 2010 Satoshi code:5cbf753(where it made sense because everything was XORed together, and the address used the high bits, while the time used the low ones). (Copied from https://github.com/bitcoin/bitcoin/pull/18642#issuecomment-613773120) (The original code was `uint256 hashRand = hashSalt ^ (((int64)addr.ip)<<32) ^ ((GetTime()+addr.ip)/(24*60*60));`) This also allows to remove a integer sanitizer suppression for the whole file. ACKs for top commit: laanwj: Code review ACKfa9f4554casipa: utACKfa9f4554capromag: Code review ACKfa9f4554ca. Tree-SHA512: f5fd107464ccd839d6749aed6914b4935e39ab42906546b3f3810a7339fc4633fef931a1783a287572af5ec64525626fa91d147d8ff52eb076740465bf5cf839
This commit is contained in:
@@ -105,6 +105,5 @@ implicit-unsigned-integer-truncation:crypto/
|
||||
shift-base:arith_uint256.cpp
|
||||
shift-base:crypto/
|
||||
shift-base:hash.cpp
|
||||
shift-base:net_processing.cpp
|
||||
shift-base:streams.h
|
||||
shift-base:util/bip32.cpp
|
||||
|
||||
Reference in New Issue
Block a user