Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

protocol.h
Go to the documentation of this file.
1 // Copyright (c) 2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2015 The Bitcoin Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef BITCOIN_RPCPROTOCOL_H
7 #define BITCOIN_RPCPROTOCOL_H
8 
9 #include <fs.h>
10 
11 #include <list>
12 #include <map>
13 #include <stdint.h>
14 #include <string>
15 
16 #include <univalue.h>
17 
20 {
21  HTTP_OK = 200,
29 };
30 
33 {
35  // RPC_INVALID_REQUEST is internally mapped to HTTP_BAD_REQUEST (400).
36  // It should not be used for application-layer errors.
38  // RPC_METHOD_NOT_FOUND is internally mapped to HTTP_NOT_FOUND (404).
39  // It should not be used for application-layer errors.
42  // RPC_INTERNAL_ERROR should only be used for genuine errors in dashd
43  // (for example datadir corruption).
45  RPC_PARSE_ERROR = -32700,
46 
59  RPC_IN_WARMUP = -28,
61 
66 
75 
88 };
89 
90 UniValue JSONRPCRequestObj(const std::string& strMethod, const UniValue& params, const UniValue& id);
91 UniValue JSONRPCReplyObj(const UniValue& result, const UniValue& error, const UniValue& id);
92 std::string JSONRPCReply(const UniValue& result, const UniValue& error, const UniValue& id);
93 UniValue JSONRPCError(int code, const std::string& message);
94 
96 bool GenerateAuthCookie(std::string *cookie_out);
98 bool GetAuthCookie(std::string *cookie_out);
100 void DeleteAuthCookie();
102 std::vector<UniValue> JSONRPCProcessBatchReply(const UniValue &in, size_t num);
103 
104 #endif // BITCOIN_RPCPROTOCOL_H
No wallet specified (error when there are multiple wallets loaded)
Definition: protocol.h:87
UniValue JSONRPCReplyObj(const UniValue &result, const UniValue &error, const UniValue &id)
Definition: protocol.cpp:36
Aliases for backward compatibility.
Definition: protocol.h:63
std::string JSONRPCReply(const UniValue &result, const UniValue &error, const UniValue &id)
Definition: protocol.cpp:48
Node has not been added before.
Definition: protocol.h:71
Keypool ran out, call keypoolrefill first.
Definition: protocol.h:80
Ran out of memory during operation.
Definition: protocol.h:52
Enter the wallet passphrase with walletpassphrase first.
Definition: protocol.h:81
bool GenerateAuthCookie(std::string *cookie_out)
Generate a new RPC authentication cookie and write it to disk.
Definition: protocol.cpp:79
Wallet is already unlocked.
Definition: protocol.h:85
Transaction or block was rejected by network rules.
Definition: protocol.h:57
HTTPStatusCode
HTTP status codes.
Definition: protocol.h:19
bool GetAuthCookie(std::string *cookie_out)
Read the RPC authentication cookie from disk.
Definition: protocol.cpp:112
Client still warming up.
Definition: protocol.h:59
Invalid, missing or duplicate parameter.
Definition: protocol.h:53
UniValue JSONRPCRequestObj(const std::string &strMethod, const UniValue &params, const UniValue &id)
JSON-RPC protocol.
Definition: protocol.cpp:27
General error during transaction or block submission.
Definition: protocol.h:56
The wallet passphrase entered was incorrect.
Definition: protocol.h:82
Transaction already in chain.
Definition: protocol.h:58
Unexpected type was passed as parameter.
Definition: protocol.h:50
Command given in wrong wallet encryption state (encrypting an encrypted wallet etc.)
Definition: protocol.h:83
General application defined errors.
Definition: protocol.h:48
Invalid address or key.
Definition: protocol.h:51
Invalid IP/Subnet.
Definition: protocol.h:73
Invalid wallet specified.
Definition: protocol.h:86
Invalid account name.
Definition: protocol.h:79
RPC method is deprecated.
Definition: protocol.h:60
void DeleteAuthCookie()
Delete RPC authentication cookie from disk.
Definition: protocol.cpp:128
Database error.
Definition: protocol.h:54
Failed to encrypt the wallet.
Definition: protocol.h:84
std::vector< UniValue > JSONRPCProcessBatchReply(const UniValue &in, size_t num)
Parse JSON-RPC batch reply into a vector.
Definition: protocol.cpp:137
Not enough funds in wallet or account.
Definition: protocol.h:78
Node to disconnect not found in connected nodes.
Definition: protocol.h:72
Node is already added.
Definition: protocol.h:70
Server is in safe mode, and command is not allowed in safe mode.
Definition: protocol.h:49
UniValue JSONRPCError(int code, const std::string &message)
Definition: protocol.cpp:54
bool error(const char *fmt, const Args &... args)
Definition: util.h:222
Standard JSON-RPC 2.0 errors.
Definition: protocol.h:37
Wallet errors.
Definition: protocol.h:77
No valid connection manager instance found.
Definition: protocol.h:74
RPCErrorCode
Dash Core RPC error codes.
Definition: protocol.h:32
Still downloading initial blocks.
Definition: protocol.h:69
P2P client errors.
Definition: protocol.h:68
Error parsing or validating structure in raw format.
Definition: protocol.h:55
Released under the MIT license