mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
Merge #9853: Fix error codes from various RPCs
adaa281Update release notes to include RPC error code changes. (John Newbery)338bf06Add commenting around JSON error codes (John Newbery)dab804cReturn correct error codes in fundrawtransaction(). (John Newbery)a012087Return correct error codes in setban(). (John Newbery)960bc7fReturn correct error codes in removeprunedfunds(). (John Newbery)c119096Return correct error codes in blockchain.cpp. (John Newbery)6d07c62Return correct error codes in bumpfee(). (John Newbery) Tree-SHA512: 4bb39ad221cd8c83d98ac5d7ad642f3a8c265522720dc86b2eebc70e74439a85b06d6ddcd6a874e879d986511de3ab0878bb7fe58b50cb0546b78913632ea809
This commit is contained in:
@@ -504,7 +504,7 @@ UniValue setban(const JSONRPCRequest& request)
|
||||
LookupSubNet(request.params[0].get_str().c_str(), subNet);
|
||||
|
||||
if (! (isSubnet ? subNet.IsValid() : netAddr.IsValid()) )
|
||||
throw JSONRPCError(RPC_CLIENT_NODE_ALREADY_ADDED, "Error: Invalid IP/Subnet");
|
||||
throw JSONRPCError(RPC_CLIENT_INVALID_IP_OR_SUBNET, "Error: Invalid IP/Subnet");
|
||||
|
||||
if (strCommand == "add")
|
||||
{
|
||||
@@ -524,7 +524,7 @@ UniValue setban(const JSONRPCRequest& request)
|
||||
else if(strCommand == "remove")
|
||||
{
|
||||
if (!( isSubnet ? g_connman->Unban(subNet) : g_connman->Unban(netAddr) ))
|
||||
throw JSONRPCError(RPC_MISC_ERROR, "Error: Unban failed");
|
||||
throw JSONRPCError(RPC_CLIENT_INVALID_IP_OR_SUBNET, "Error: Unban failed. Requested address/subnet was not previously banned.");
|
||||
}
|
||||
return NullUniValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user