MCPcopy Create free account
hub / github.com/Bitcoin-ABC/bitcoin-abc / IsPeerAddrLocalGood

Function IsPeerAddrLocalGood

src/net.cpp:240–244  ·  view source on GitHub ↗

Is our peer's addrLocal potentially useful as an external IP source?

Source from the content-addressed store, hash-verified

238
239// Is our peer's addrLocal potentially useful as an external IP source?
240bool IsPeerAddrLocalGood(CNode *pnode) {
241 CService addrLocal = pnode->GetAddrLocal();
242 return fDiscover && pnode->addr.IsRoutable() && addrLocal.IsRoutable() &&
243 IsReachable(addrLocal.GetNetwork());
244}
245
246std::optional<CService> GetLocalAddrForPeer(CNode &node) {
247 CService addrLocal{GetLocalAddress(node.addr)};

Callers 1

GetLocalAddrForPeerFunction · 0.85

Calls 4

IsReachableFunction · 0.85
GetAddrLocalMethod · 0.80
IsRoutableMethod · 0.80
GetNetworkMethod · 0.80

Tested by

no test coverage detected