diff options
author | Martin Zumsande <mzumsande@gmail.com> | 2022-06-08 15:22:41 -0400 |
---|---|---|
committer | Martin Zumsande <mzumsande@gmail.com> | 2022-06-10 10:50:07 -0400 |
commit | 99b9e5f3a9fa29bbc1e45fc958470fbcc207ef23 (patch) | |
tree | 2e750b7e17412ba97ba9e1f5a02937bfb224a1a1 /src/net.cpp | |
parent | 455780b1aebae21ebd5d83d2f0ff6a2264ac9608 (diff) | |
download | bitcoin-99b9e5f3a9fa29bbc1e45fc958470fbcc207ef23.tar.xz |
p2p: always set nTime for self-advertisements
If we self-advertised to an inbound peer with the address they gave us,
nTime was left default-initialized, so that our peer wouldn't relay it
any further along.
Diffstat (limited to 'src/net.cpp')
-rw-r--r-- | src/net.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net.cpp b/src/net.cpp index 82b5a69eb5..835ec77d57 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -250,7 +250,7 @@ std::optional<CAddress> GetLocalAddrForPeer(CNode *pnode) if (pnode->IsInboundConn()) { // For inbound connections, assume both the address and the port // as seen from the peer. - addrLocal = CAddress{pnode->GetAddrLocal(), addrLocal.nServices}; + addrLocal = CAddress{pnode->GetAddrLocal(), addrLocal.nServices, addrLocal.nTime}; } else { // For outbound connections, assume just the address as seen from // the peer and leave the port in `addrLocal` as returned by |