From 7f31762cb6261806542cc6d1188ca07db98a6950 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 23 May 2017 20:04:38 -0400 Subject: 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). --- src/rpc/net.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/rpc/net.cpp') diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index 10bf99eb38..ab4ecbcf17 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -397,7 +397,7 @@ static UniValue GetNetworksInfo() for(int n=0; n(n); - if(network == NET_UNROUTABLE) + if(network == NET_UNROUTABLE || network == NET_INTERNAL) continue; proxyType proxy; UniValue obj(UniValue::VOBJ); -- cgit v1.2.3