aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2017-05-23 20:04:38 -0400
committerCory Fields <cory-nospam-@coryfields.com>2017-06-14 18:05:00 -0400
commit7f31762cb6261806542cc6d1188ca07db98a6950 (patch)
tree6ed637d6ebbb0a3d572b1dfa02bbd152fbae6c32 /src/net.cpp
parentfbf5d3ba15161f71cbb84a51c1703c22b651e8a9 (diff)
net: add an internal subnet for representing unresolved hostnames
We currently do two resolves for dns seeds: one for the results, and one to serve in addrman as the source for those addresses. There's no requirement that the source hostname resolves to the stored identifier, only that the mapping is unique. So rather than incurring the second lookup, combine a private subnet with a hash of the hostname. The resulting v6 ip is guaranteed not to be publicy routable, and has only a negligible chance of colliding with a user's internal network (which would be of no consequence anyway).
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 75d1719e86..e10016d983 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -240,7 +240,7 @@ bool RemoveLocal(const CService& addr)
/** Make a particular network entirely off-limits (no automatic connects to it) */
void SetLimited(enum Network net, bool fLimited)
{
- if (net == NET_UNROUTABLE)
+ if (net == NET_UNROUTABLE || net == NET_INTERNAL)
return;
LOCK(cs_mapLocalHost);
vfLimited[net] = fLimited;