11// Copyright (c) 2010 Satoshi Nakamoto
22// Copyright (c) 2009-2014 The Bitcoin developers
3- // Distributed under the MIT/X11 software license, see the accompanying
3+ // Distributed under the MIT software license, see the accompanying
44// file COPYING or http://www.opensource.org/licenses/mit-license.php.
55
66#ifndef BITCOIN_RPCPROTOCOL_H
1919#include " json/json_spirit_utils.h"
2020#include " json/json_spirit_writer_template.h"
2121
22- // HTTP status codes
22+ // ! HTTP status codes
2323enum HTTPStatusCode
2424{
2525 HTTP_OK = 200 ,
@@ -30,56 +30,56 @@ enum HTTPStatusCode
3030 HTTP_INTERNAL_SERVER_ERROR = 500 ,
3131};
3232
33- // Bitcoin RPC error codes
33+ // ! Bitcoin RPC error codes
3434enum RPCErrorCode
3535{
36- // Standard JSON-RPC 2.0 errors
36+ // ! Standard JSON-RPC 2.0 errors
3737 RPC_INVALID_REQUEST = -32600 ,
3838 RPC_METHOD_NOT_FOUND = -32601 ,
3939 RPC_INVALID_PARAMS = -32602 ,
4040 RPC_INTERNAL_ERROR = -32603 ,
4141 RPC_PARSE_ERROR = -32700 ,
4242
43- // General application defined errors
44- RPC_MISC_ERROR = -1 , // std::exception thrown in command handling
45- RPC_FORBIDDEN_BY_SAFE_MODE = -2 , // Server is in safe mode, and command is not allowed in safe mode
46- RPC_TYPE_ERROR = -3 , // Unexpected type was passed as parameter
47- RPC_INVALID_ADDRESS_OR_KEY = -5 , // Invalid address or key
48- RPC_OUT_OF_MEMORY = -7 , // Ran out of memory during operation
49- RPC_INVALID_PARAMETER = -8 , // Invalid, missing or duplicate parameter
50- RPC_DATABASE_ERROR = -20 , // Database error
51- RPC_DESERIALIZATION_ERROR = -22 , // Error parsing or validating structure in raw format
52- RPC_VERIFY_ERROR = -25 , // General error during transaction or block submission
53- RPC_VERIFY_REJECTED = -26 , // Transaction or block was rejected by network rules
54- RPC_VERIFY_ALREADY_IN_CHAIN = -27 , // Transaction already in chain
55- RPC_IN_WARMUP = -28 , // Client still warming up
43+ // ! General application defined errors
44+ RPC_MISC_ERROR = -1 , // ! std::exception thrown in command handling
45+ RPC_FORBIDDEN_BY_SAFE_MODE = -2 , // ! Server is in safe mode, and command is not allowed in safe mode
46+ RPC_TYPE_ERROR = -3 , // ! Unexpected type was passed as parameter
47+ RPC_INVALID_ADDRESS_OR_KEY = -5 , // ! Invalid address or key
48+ RPC_OUT_OF_MEMORY = -7 , // ! Ran out of memory during operation
49+ RPC_INVALID_PARAMETER = -8 , // ! Invalid, missing or duplicate parameter
50+ RPC_DATABASE_ERROR = -20 , // ! Database error
51+ RPC_DESERIALIZATION_ERROR = -22 , // ! Error parsing or validating structure in raw format
52+ RPC_VERIFY_ERROR = -25 , // ! General error during transaction or block submission
53+ RPC_VERIFY_REJECTED = -26 , // ! Transaction or block was rejected by network rules
54+ RPC_VERIFY_ALREADY_IN_CHAIN = -27 , // ! Transaction already in chain
55+ RPC_IN_WARMUP = -28 , // ! Client still warming up
5656
57- // Aliases for backward compatibility
57+ // ! Aliases for backward compatibility
5858 RPC_TRANSACTION_ERROR = RPC_VERIFY_ERROR,
5959 RPC_TRANSACTION_REJECTED = RPC_VERIFY_REJECTED,
6060 RPC_TRANSACTION_ALREADY_IN_CHAIN= RPC_VERIFY_ALREADY_IN_CHAIN,
6161
62- // P2P client errors
63- RPC_CLIENT_NOT_CONNECTED = -9 , // Bitcoin is not connected
64- RPC_CLIENT_IN_INITIAL_DOWNLOAD = -10 , // Still downloading initial blocks
65- RPC_CLIENT_NODE_ALREADY_ADDED = -23 , // Node is already added
66- RPC_CLIENT_NODE_NOT_ADDED = -24 , // Node has not been added before
62+ // ! P2P client errors
63+ RPC_CLIENT_NOT_CONNECTED = -9 , // ! Bitcoin is not connected
64+ RPC_CLIENT_IN_INITIAL_DOWNLOAD = -10 , // ! Still downloading initial blocks
65+ RPC_CLIENT_NODE_ALREADY_ADDED = -23 , // ! Node is already added
66+ RPC_CLIENT_NODE_NOT_ADDED = -24 , // ! Node has not been added before
6767
68- // Wallet errors
69- RPC_WALLET_ERROR = -4 , // Unspecified problem with wallet (key not found etc.)
70- RPC_WALLET_INSUFFICIENT_FUNDS = -6 , // Not enough funds in wallet or account
71- RPC_WALLET_INVALID_ACCOUNT_NAME = -11 , // Invalid account name
72- RPC_WALLET_KEYPOOL_RAN_OUT = -12 , // Keypool ran out, call keypoolrefill first
73- RPC_WALLET_UNLOCK_NEEDED = -13 , // Enter the wallet passphrase with walletpassphrase first
74- RPC_WALLET_PASSPHRASE_INCORRECT = -14 , // The wallet passphrase entered was incorrect
75- RPC_WALLET_WRONG_ENC_STATE = -15 , // Command given in wrong wallet encryption state (encrypting an encrypted wallet etc.)
76- RPC_WALLET_ENCRYPTION_FAILED = -16 , // Failed to encrypt the wallet
77- RPC_WALLET_ALREADY_UNLOCKED = -17 , // Wallet is already unlocked
68+ // ! Wallet errors
69+ RPC_WALLET_ERROR = -4 , // ! Unspecified problem with wallet (key not found etc.)
70+ RPC_WALLET_INSUFFICIENT_FUNDS = -6 , // ! Not enough funds in wallet or account
71+ RPC_WALLET_INVALID_ACCOUNT_NAME = -11 , // ! Invalid account name
72+ RPC_WALLET_KEYPOOL_RAN_OUT = -12 , // ! Keypool ran out, call keypoolrefill first
73+ RPC_WALLET_UNLOCK_NEEDED = -13 , // ! Enter the wallet passphrase with walletpassphrase first
74+ RPC_WALLET_PASSPHRASE_INCORRECT = -14 , // ! The wallet passphrase entered was incorrect
75+ RPC_WALLET_WRONG_ENC_STATE = -15 , // ! Command given in wrong wallet encryption state (encrypting an encrypted wallet etc.)
76+ RPC_WALLET_ENCRYPTION_FAILED = -16 , // ! Failed to encrypt the wallet
77+ RPC_WALLET_ALREADY_UNLOCKED = -17 , // ! Wallet is already unlocked
7878};
7979
80- //
81- // IOStream device that speaks SSL but can also speak non-SSL
82- / /
80+ /* *
81+ * IOStream device that speaks SSL but can also speak non-SSL
82+ * /
8383template <typename Protocol>
8484class SSLIOStreamDevice : public boost ::iostreams::device<boost::iostreams::bidirectional> {
8585public:
0 commit comments