mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-04 04:45:10 +02:00
Merge bitcoin/bitcoin#25814: net: simplify GetLocalAddress()
daabd41211net: simplify GetLocalAddress() (Vasil Dimov) Pull request description: 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}`. ACKs for top commit: jarolrod: ACKdaabd41211aureleoules: ACKdaabd41211. w0xlt: ACKdaabd41211Tree-SHA512: 4bbd3746bc30fbc05bb32b58bb122c938acd849c0f72f1d3e8170557c1999ec26a888e06e874c3fc22562a2becddc7d817db7d174e0e1b383e8d74c39aa1e898
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user