Skip to content

Commit 7da3b0a

Browse files
committed
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.
1 parent 2ae705d commit 7da3b0a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/rpc/protocol.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ enum RPCErrorCode
4646

4747
//! General application defined errors
4848
RPC_MISC_ERROR = -1, //!< std::exception thrown in command handling
49-
RPC_FORBIDDEN_BY_SAFE_MODE = -2, //!< Server is in safe mode, and command is not allowed in safe mode
5049
RPC_TYPE_ERROR = -3, //!< Unexpected type was passed as parameter
5150
RPC_INVALID_ADDRESS_OR_KEY = -5, //!< Invalid address or key
5251
RPC_OUT_OF_MEMORY = -7, //!< Ran out of memory during operation
@@ -88,6 +87,9 @@ enum RPCErrorCode
8887

8988
//! Backwards compatible aliases
9089
RPC_WALLET_INVALID_ACCOUNT_NAME = RPC_WALLET_INVALID_LABEL_NAME,
90+
91+
//! Unused reserved codes, kept around for backwards compatibility. Do not reuse.
92+
RPC_FORBIDDEN_BY_SAFE_MODE = -2, //!< Server is in safe mode, and command is not allowed in safe mode
9193
};
9294

9395
UniValue JSONRPCRequestObj(const std::string& strMethod, const UniValue& params, const UniValue& id);

0 commit comments

Comments
 (0)