From 31d6b1d5f0414d8b356d8cb9c99961d8a04d6c0a Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 31 May 2016 13:05:52 -0400 Subject: net: Split resolving out of CNetAddr --- src/rpc/net.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/rpc') diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index b85c7b2e1a..c23becd4a9 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -494,8 +494,11 @@ UniValue setban(const UniValue& params, bool fHelp) if (params[0].get_str().find("/") != string::npos) isSubnet = true; - if (!isSubnet) - netAddr = CNetAddr(params[0].get_str()); + if (!isSubnet) { + CNetAddr resolved; + LookupHost(params[0].get_str().c_str(), resolved, false); + netAddr = resolved; + } else subNet = CSubNet(params[0].get_str()); -- cgit v1.2.3 From b6c3ff3daed432e71d1c5bfe2357c4bb9fdc862a Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 31 May 2016 15:50:24 -0400 Subject: net: Split resolving out of CSubNet --- src/rpc/net.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/rpc') diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index c23becd4a9..58cf4a56e0 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -500,7 +500,7 @@ UniValue setban(const UniValue& params, bool fHelp) netAddr = resolved; } else - subNet = CSubNet(params[0].get_str()); + LookupSubNet(params[0].get_str().c_str(), subNet); if (! (isSubnet ? subNet.IsValid() : netAddr.IsValid()) ) throw JSONRPCError(RPC_CLIENT_NODE_ALREADY_ADDED, "Error: Invalid IP/Subnet"); -- cgit v1.2.3