Browse Source

Rename RPC_TRANSACTION_* errors to RPC_VERIFY_* and use RPC_VERIFY_ERROR for submitblock

0.10
Luke Dashjr 11 years ago
parent
commit
d29a2917ff
  1. 2
      src/rpcmining.cpp
  2. 11
      src/rpcprotocol.h

2
src/rpcmining.cpp

@ -589,7 +589,7 @@ Value submitblock(const Array& params, bool fHelp)
if (state.IsError()) if (state.IsError())
{ {
std::string strRejectReason = state.GetRejectReason(); std::string strRejectReason = state.GetRejectReason();
throw JSONRPCError(RPC_MISC_ERROR, strRejectReason); throw JSONRPCError(RPC_VERIFY_ERROR, strRejectReason);
} }
if (state.IsInvalid()) if (state.IsInvalid())
return "rejected"; // TODO: report validation state return "rejected"; // TODO: report validation state

11
src/rpcprotocol.h

@ -49,9 +49,14 @@ enum RPCErrorCode
RPC_INVALID_PARAMETER = -8, // Invalid, missing or duplicate parameter RPC_INVALID_PARAMETER = -8, // Invalid, missing or duplicate parameter
RPC_DATABASE_ERROR = -20, // Database error RPC_DATABASE_ERROR = -20, // Database error
RPC_DESERIALIZATION_ERROR = -22, // Error parsing or validating structure in raw format RPC_DESERIALIZATION_ERROR = -22, // Error parsing or validating structure in raw format
RPC_TRANSACTION_ERROR = -25, // General error during transaction submission RPC_VERIFY_ERROR = -25, // General error during transaction or block submission
RPC_TRANSACTION_REJECTED = -26, // Transaction was rejected by network rules RPC_VERIFY_REJECTED = -26, // Transaction or block was rejected by network rules
RPC_TRANSACTION_ALREADY_IN_CHAIN= -27, // Transaction already in chain RPC_VERIFY_ALREADY_IN_CHAIN = -27, // Transaction already in chain
// Aliases for backward compatibility
RPC_TRANSACTION_ERROR = RPC_VERIFY_ERROR,
RPC_TRANSACTION_REJECTED = RPC_VERIFY_REJECTED,
RPC_TRANSACTION_ALREADY_IN_CHAIN= RPC_VERIFY_ALREADY_IN_CHAIN,
// P2P client errors // P2P client errors
RPC_CLIENT_NOT_CONNECTED = -9, // Bitcoin is not connected RPC_CLIENT_NOT_CONNECTED = -9, // Bitcoin is not connected

Loading…
Cancel
Save