mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +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
1 changed files with 2 additions and 3 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue