diff options
Diffstat (limited to 'src/net.cpp')
| -rw-r--r-- | src/net.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/net.cpp b/src/net.cpp index c8cb17091..e48b30095 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -211,6 +211,12 @@ bool AddLocal(const CService& addr, int nScore) if (!addr.IsRoutable()) return false; + if (!GetBoolArg("-discover", true) && nScore < LOCAL_MANUAL) + return false; + + if (IsLimited(addr)) + return false; + printf("AddLocal(%s,%i)\n", addr.ToString().c_str(), nScore); { @@ -239,14 +245,21 @@ bool AddLocal(const CNetAddr &addr, int nScore) /** Make a particular network entirely off-limits (no automatic connects to it) */ void SetLimited(enum Network net, bool fLimited) { + if (net == NET_UNROUTABLE) + return; LOCK(cs_mapLocalHost); vfLimited[net] = fLimited; } -bool IsLimited(const CNetAddr& addr) +bool IsLimited(enum Network net) { LOCK(cs_mapLocalHost); - return vfLimited[addr.GetNetwork()]; + return vfLimited[net]; +} + +bool IsLimited(const CNetAddr &addr) +{ + return IsLimited(addr.GetNetwork()); } /** vote for a local address */ |