From e4d541c7cfa65da77e80e6786fdcb197ab50d04b Mon Sep 17 00:00:00 2001 From: Martin Zumsande Date: Tue, 11 Apr 2023 16:10:28 -0400 Subject: net, refactor: pass reference for peer address in GetReachabilityFrom The address of the peer always exists (because addr is a member of CNode), so it was not possible to pass a nullptr before. Also remove NET_UNKNOWN, which is unused now. --- src/net.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/net.cpp') diff --git a/src/net.cpp b/src/net.cpp index ab0d34fc63..9379f5be78 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -165,7 +165,7 @@ bool GetLocal(CService& addr, const CNode& peer) for (const auto& entry : mapLocalHost) { int nScore = entry.second.nScore; - int nReachability = entry.first.GetReachabilityFrom(&peer.addr); + int nReachability = entry.first.GetReachabilityFrom(peer.addr); if (nReachability > nBestReachability || (nReachability == nBestReachability && nScore > nBestScore)) { addr = CService(entry.first, entry.second.nPort); -- cgit v1.2.3