From 79e67fd96a3ba1680fd24ac0110faa8ea1464c84 Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Wed, 10 Aug 2022 15:09:29 +0200 Subject: [PATCH] merge bitcoin#25814: simplify GetLocalAddress() --- src/net.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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)