mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-12 18:01:57 +02:00
net: simplify GetLocalAddress()
There is no need to use two variables `ret` and `addr` of the same type `CService` and assign one to the other in a strange way like `ret = CService{addr}`.
This commit is contained in:
parent
c012875b9d
commit
daabd41211
@ -208,12 +208,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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user