mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user