merge bitcoin#25814: simplify GetLocalAddress()

This commit is contained in:
Kittywhiskers Van Gogh 2022-08-10 15:09:29 +02:00
parent 6d4945418a
commit 79e67fd96a
No known key found for this signature in database
GPG Key ID: 30CD0C065E5C4AAD

View File

@ -238,12 +238,11 @@ static std::vector<CAddress> ConvertSeeds(const std::vector<uint8_t> &vSeedsIn)
// one by discovery.
CService GetLocalAddress(const CNetAddr& addrPeer)
{
CService ret{CNetAddr(), GetListenPort()};
CService addr;
if (GetLocal(addr, &addrPeer)) {
ret = CService{addr};
return addr;
}
return ret;
return CService{CNetAddr(), GetListenPort()};
}
static int GetnScore(const CService& addr)