diff options
| author | Wladimir J. van der Laan <[email protected]> | 2016-08-15 13:33:46 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2016-08-15 13:35:27 +0200 |
| commit | 1030fa718c59c29d3208af13e853457b7ac59d2e (patch) | |
| tree | f2ba7f33f972be99ef8198e3e9676131b8f2dc8f /src/rpc/net.cpp | |
| parent | Merge #7946: Reduce cs_main locks during ConnectTip/SyncWithWallets (diff) | |
| parent | net: fixup nits (diff) | |
| download | discoin-1030fa718c59c29d3208af13e853457b7ac59d2e.tar.xz discoin-1030fa718c59c29d3208af13e853457b7ac59d2e.zip | |
Merge #8128: Net: Turn net structures into dumb storage classes
9e9d644 net: fixup nits (Cory Fields)
8945384 net: Have LookupNumeric return a CService directly (Cory Fields)
21ba407 net: narrow include scope after moving to netaddress (Cory Fields)
21e5b96 net: move CNetAddr/CService/CSubNet out of netbase (Cory Fields)
1017b8a net: Add direct tests for new CSubNet constructors (Cory Fields)
b6c3ff3 net: Split resolving out of CSubNet (Cory Fields)
f96c7c4 net: Split resolving out of CService (Cory Fields)
31d6b1d net: Split resolving out of CNetAddr (Cory Fields)
Diffstat (limited to 'src/rpc/net.cpp')
| -rw-r--r-- | src/rpc/net.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index b85c7b2e1..58cf4a56e 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -494,10 +494,13 @@ 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()); + 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"); |