Skip to content

Commit 79e67fd

Browse files
committed
merge bitcoin#25814: simplify GetLocalAddress()
1 parent 6d49454 commit 79e67fd

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/net.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,11 @@ static std::vector<CAddress> ConvertSeeds(const std::vector<uint8_t> &vSeedsIn)
238238
// one by discovery.
239239
CService GetLocalAddress(const CNetAddr& addrPeer)
240240
{
241-
CService ret{CNetAddr(), GetListenPort()};
242241
CService addr;
243242
if (GetLocal(addr, &addrPeer)) {
244-
ret = CService{addr};
243+
return addr;
245244
}
246-
return ret;
245+
return CService{CNetAddr(), GetListenPort()};
247246
}
248247

249248
static int GetnScore(const CService& addr)

0 commit comments

Comments
 (0)