aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authordergoegge <n.goeggi@gmail.com>2022-07-04 18:02:28 +0200
committerdergoegge <n.goeggi@gmail.com>2022-07-14 15:24:00 +0200
commit5961f8eea1ad5be1a4bf8da63651e197a20359b2 (patch)
tree3d822083a7eacadb241e87ad5625f946852c76eb /src/net_processing.cpp
parentd9079fe18dc5d81ce290876353555b51125127d1 (diff)
downloadbitcoin-5961f8eea1ad5be1a4bf8da63651e197a20359b2.tar.xz
[net] Return CService from GetLocalAddrForPeer and GetLocalAddress
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 64ce34a7b8..9d19b95986 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -2930,7 +2930,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
// indicate to the peer that we will participate in addr relay.
if (fListen && !m_chainman.ActiveChainstate().IsInitialBlockDownload())
{
- CAddress addr = GetLocalAddress(&pfrom.addr, pfrom.GetLocalServices());
+ CAddress addr{GetLocalAddress(pfrom.addr), peer->m_our_services, (uint32_t)GetAdjustedTime()};
FastRandomContext insecure_rand;
if (addr.IsRoutable())
{
@@ -4685,9 +4685,10 @@ void PeerManagerImpl::MaybeSendAddr(CNode& node, Peer& peer, std::chrono::micros
if (peer.m_next_local_addr_send != 0us) {
peer.m_addr_known->reset();
}
- if (std::optional<CAddress> local_addr = GetLocalAddrForPeer(&node)) {
+ if (std::optional<CService> local_service = GetLocalAddrForPeer(node)) {
+ CAddress local_addr{*local_service, peer.m_our_services, (uint32_t)GetAdjustedTime()};
FastRandomContext insecure_rand;
- PushAddress(peer, *local_addr, insecure_rand);
+ PushAddress(peer, local_addr, insecure_rand);
}
peer.m_next_local_addr_send = GetExponentialRand(current_time, AVG_LOCAL_ADDRESS_BROADCAST_INTERVAL);
}