diff --git a/src/net.cpp b/src/net.cpp index 806543d96f..5de0d9740a 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -238,12 +238,11 @@ static std::vector ConvertSeeds(const std::vector &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)