setban: add RPCErrorCode
This commit is contained in:
parent
d624167387
commit
1f02b80253
2 changed files with 2 additions and 1 deletions
|
@ -524,7 +524,7 @@ UniValue setban(const UniValue& params, bool fHelp)
|
||||||
else if(strCommand == "remove")
|
else if(strCommand == "remove")
|
||||||
{
|
{
|
||||||
if (!( isSubnet ? CNode::Unban(subNet) : CNode::Unban(netAddr) ))
|
if (!( isSubnet ? CNode::Unban(subNet) : CNode::Unban(netAddr) ))
|
||||||
throw JSONRPCError(RPC_CLIENT_NODE_ALREADY_ADDED, "Error: Unban failed");
|
throw JSONRPCError(RPC_MISC_ERROR, "Error: Unban failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
return NullUniValue;
|
return NullUniValue;
|
||||||
|
|
|
@ -64,6 +64,7 @@ enum RPCErrorCode
|
||||||
RPC_CLIENT_NODE_ALREADY_ADDED = -23, //! Node is already added
|
RPC_CLIENT_NODE_ALREADY_ADDED = -23, //! Node is already added
|
||||||
RPC_CLIENT_NODE_NOT_ADDED = -24, //! Node has not been added before
|
RPC_CLIENT_NODE_NOT_ADDED = -24, //! Node has not been added before
|
||||||
RPC_CLIENT_NODE_NOT_CONNECTED = -29, //! Node to disconnect not found in connected nodes
|
RPC_CLIENT_NODE_NOT_CONNECTED = -29, //! Node to disconnect not found in connected nodes
|
||||||
|
RPC_CLIENT_INVALID_IP_OR_SUBNET = -30, //! Invalid IP/Subnet
|
||||||
|
|
||||||
//! Wallet errors
|
//! Wallet errors
|
||||||
RPC_WALLET_ERROR = -4, //! Unspecified problem with wallet (key not found etc.)
|
RPC_WALLET_ERROR = -4, //! Unspecified problem with wallet (key not found etc.)
|
||||||
|
|
Loading…
Reference in a new issue