mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02: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:
parent
62d73f5370
commit
e4d541c7cf
4 changed files with 9 additions and 13 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue