Skip to content

Commit 1f02b80

Browse files
committed
setban: add RPCErrorCode
1 parent d624167 commit 1f02b80

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/rpcnet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ UniValue setban(const UniValue& params, bool fHelp)
524524
else if(strCommand == "remove")
525525
{
526526
if (!( isSubnet ? CNode::Unban(subNet) : CNode::Unban(netAddr) ))
527-
throw JSONRPCError(RPC_CLIENT_NODE_ALREADY_ADDED, "Error: Unban failed");
527+
throw JSONRPCError(RPC_MISC_ERROR, "Error: Unban failed");
528528
}
529529

530530
return NullUniValue;

src/rpcprotocol.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ enum RPCErrorCode
6464
RPC_CLIENT_NODE_ALREADY_ADDED = -23, //! Node is already added
6565
RPC_CLIENT_NODE_NOT_ADDED = -24, //! Node has not been added before
6666
RPC_CLIENT_NODE_NOT_CONNECTED = -29, //! Node to disconnect not found in connected nodes
67+
RPC_CLIENT_INVALID_IP_OR_SUBNET = -30, //! Invalid IP/Subnet
6768

6869
//! Wallet errors
6970
RPC_WALLET_ERROR = -4, //! Unspecified problem with wallet (key not found etc.)

0 commit comments

Comments
 (0)