From 7da3b0adb836794cb22668b5101a6a4748543ea0 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 27 Apr 2018 09:19:09 +0200 Subject: [PATCH] rpc: Move RPC_FORBIDDEN_BY_SAFE_MODE code to reserved section Although this code is no longer ever sent back after removing safe mode, it would be unwise to remove it from the header. For one, it would be bad to accidentally re-use the number. Also some API documentation / bindings are directly generated from the .h file - this is why the "Aliases for backward compatibility" are there. We don't want to break code that relies on this error code existing, even if it's never generated. So keep it around but move it to a reserved section. --- src/rpc/protocol.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rpc/protocol.h b/src/rpc/protocol.h index 4a265735d25..6954aed252f 100644 --- a/src/rpc/protocol.h +++ b/src/rpc/protocol.h @@ -46,7 +46,6 @@ enum RPCErrorCode //! General application defined errors RPC_MISC_ERROR = -1, //!< std::exception thrown in command handling - RPC_FORBIDDEN_BY_SAFE_MODE = -2, //!< Server is in safe mode, and command is not allowed in safe mode RPC_TYPE_ERROR = -3, //!< Unexpected type was passed as parameter RPC_INVALID_ADDRESS_OR_KEY = -5, //!< Invalid address or key RPC_OUT_OF_MEMORY = -7, //!< Ran out of memory during operation @@ -88,6 +87,9 @@ enum RPCErrorCode //! Backwards compatible aliases RPC_WALLET_INVALID_ACCOUNT_NAME = RPC_WALLET_INVALID_LABEL_NAME, + + //! Unused reserved codes, kept around for backwards compatibility. Do not reuse. + RPC_FORBIDDEN_BY_SAFE_MODE = -2, //!< Server is in safe mode, and command is not allowed in safe mode }; UniValue JSONRPCRequestObj(const std::string& strMethod, const UniValue& params, const UniValue& id);