mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
IsReachable is the inverse of IsLimited (DRY). Includes unit tests
This commit is contained in:
parent
86e0a33f5c
commit
6dc4593db1
2 changed files with 91 additions and 4 deletions
|
|
@ -286,15 +286,13 @@ bool IsLocal(const CService& addr)
|
|||
/** check whether a given network is one we can probably connect to */
|
||||
bool IsReachable(enum Network net)
|
||||
{
|
||||
LOCK(cs_mapLocalHost);
|
||||
return !vfLimited[net];
|
||||
return !IsLimited(net);
|
||||
}
|
||||
|
||||
/** check whether a given address is in a network we can probably connect to */
|
||||
bool IsReachable(const CNetAddr& addr)
|
||||
{
|
||||
enum Network net = addr.GetNetwork();
|
||||
return IsReachable(net);
|
||||
return IsReachable(addr.GetNetwork());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue