mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
[net] Change AdvertiseLocal to GetLocalAddrForPeer
Gossiping addresses to peers is the responsibility of net processing. Change AdvertiseLocal() in net to just return an (optional) address for net processing to advertise. Update function name to reflect new responsibility.
This commit is contained in:
parent
9bbf08bf98
commit
d21d2b264c
4 changed files with 12 additions and 7 deletions
|
|
@ -4426,7 +4426,10 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
|
|||
if (pto->m_next_local_addr_send != 0us) {
|
||||
pto->m_addr_known->reset();
|
||||
}
|
||||
AdvertiseLocal(pto);
|
||||
if (Optional<CAddress> local_addr = GetLocalAddrForPeer(pto)) {
|
||||
FastRandomContext insecure_rand;
|
||||
pto->PushAddress(*local_addr, insecure_rand);
|
||||
}
|
||||
pto->m_next_local_addr_send = PoissonNextSend(current_time, AVG_LOCAL_ADDRESS_BROADCAST_INTERVAL);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue