mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Merge ba11eb354b into merged_master (Bitcoin PR bitcoin/bitcoin#23542)
This commit is contained in:
commit
1dc6ad6ea9
11 changed files with 274 additions and 20 deletions
|
|
@ -1779,8 +1779,10 @@ void PeerManagerImpl::RelayAddress(NodeId originator,
|
|||
// Relay to a limited number of other nodes
|
||||
// Use deterministic randomness to send to the same nodes for 24 hours
|
||||
// at a time so the m_addr_knowns of the chosen nodes prevent repeats
|
||||
const uint64_t hashAddr{addr.GetHash()};
|
||||
const CSipHasher hasher{m_connman.GetDeterministicRandomizer(RANDOMIZER_ID_ADDRESS_RELAY).Write(hashAddr).Write((GetTime() + hashAddr) / (24 * 60 * 60))};
|
||||
const uint64_t hash_addr{CServiceHash(0, 0)(addr)};
|
||||
const CSipHasher hasher{m_connman.GetDeterministicRandomizer(RANDOMIZER_ID_ADDRESS_RELAY)
|
||||
.Write(hash_addr)
|
||||
.Write((GetTime() + hash_addr) / (24 * 60 * 60))};
|
||||
FastRandomContext insecure_rand;
|
||||
|
||||
// Relay reachable addresses to 2 peers. Unreachable addresses are relayed randomly to 1 or 2 peers.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue