55 throw std::runtime_error(
57 "\nReturns an object containing various state info.\n"
61 " \"version\": xxxxx, (numeric) the server version\n"
62 " \"protocolversion\": xxxxx, (numeric) the protocol version\n"
63 " \"services\": \"xxxx\", (string) The network services provided by this client\n"
64 " \"walletversion\": xxxxx, (numeric) the wallet version\n"
65 " \"balance\": xxxxxxx, (numeric) the total pivx balance of the wallet\n"
66 " \"staking status\": true|false, (boolean) if the wallet is staking or not\n"
67 " \"blocks\": xxxxxx, (numeric) the current number of blocks processed in the server\n"
68 " \"timeoffset\": xxxxx, (numeric) the time offset\n"
69 " \"connections\": xxxxx, (numeric) the number of connections\n"
70 " \"proxy\": \"host:port\", (string, optional) the proxy used by the server\n"
71 " \"difficulty\": xxxxxx, (numeric) the current difficulty\n"
72 " \"testnet\": true|false, (boolean) if the server is using testnet or not\n"
73 " \"moneysupply\": n (numeric) The sum of transparentsupply and shieldedsupply\n"
74 " \"transparentsupply\" : n (numeric) The sum of the value of all unspent outputs when the chainstate was\n"
75 " last flushed to disk (use getsupplyinfo to know the update-height, or\n"
76 " to trigger the money supply update/recalculation)"
77 " \"shieldsupply\": n (numeric) Chain tip shield pool value\n"
78 " \"keypoololdest\": xxxxxx, (numeric) the timestamp (seconds since GMT epoch) of the oldest pre-generated key in the key pool\n"
79 " \"keypoolsize\": xxxx, (numeric) how many new keys are pre-generated\n"
80 " \"unlocked_until\": ttt, (numeric) the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked\n"
81 " \"paytxfee\": x.xxxx, (numeric) the transaction fee set in " +
CURRENCY_UNIT +
"/kB\n"
82 " \"relayfee\": x.xxxx, (numeric) minimum relay fee for transactions in " +
CURRENCY_UNIT +
"/kB\n"
83 " \"errors\": \"...\" (string) any error messages\n"
96 for (
int i = 0; i < 8; i++) {
97 uint64_t check = 1 << i;
98 if (
g_connman->GetLocalServices() & check) {
101 services+=
"NETWORK/";
108 services+=
"UNKNOWN/";
117 obj.
pushKV(
"version", CLIENT_VERSION);
118 obj.
pushKV(
"protocolversion", PROTOCOL_VERSION);
119 obj.
pushKV(
"services", services);
138 obj.
pushKV(
"moneysupply", supply_info[
"totalsupply"]);
139 obj.
pushKV(
"transparentsupply", supply_info[
"transparentsupply"]);
140 obj.
pushKV(
"shieldsupply", supply_info[
"shieldsupply"]);
146 obj.
pushKV(
"keypoolsize", (int64_t)kpExternalSize);
163 if (request.
fHelp || request.
params.
size() != 1 || (strMode !=
"status" && strMode !=
"reset")) {
164 throw std::runtime_error(
165 "mnsync \"status|reset\"\n"
166 "\nReturns the sync status or resets sync.\n"
169 "1. \"mode\" (string, required) either 'status' or 'reset'\n"
171 "\nResult ('status' mode):\n"
173 " \"IsBlockchainSynced\": true|false, (boolean) 'true' if blockchain is synced\n"
174 " \"lastMasternodeList\": xxxx, (numeric) Timestamp of last MN list message\n"
175 " \"lastMasternodeWinner\": xxxx, (numeric) Timestamp of last MN winner message\n"
176 " \"lastBudgetItem\": xxxx, (numeric) Timestamp of last MN budget message\n"
177 " \"lastFailure\": xxxx, (numeric) Timestamp of last failed sync\n"
178 " \"nCountFailures\": n, (numeric) Number of failed syncs (total)\n"
179 " \"sumMasternodeList\": n, (numeric) Number of MN list messages (total)\n"
180 " \"sumMasternodeWinner\": n, (numeric) Number of MN winner messages (total)\n"
181 " \"sumBudgetItemProp\": n, (numeric) Number of MN budget messages (total)\n"
182 " \"sumBudgetItemFin\": n, (numeric) Number of MN budget finalization messages (total)\n"
183 " \"countMasternodeList\": n, (numeric) Number of MN list messages (local)\n"
184 " \"countMasternodeWinner\": n, (numeric) Number of MN winner messages (local)\n"
185 " \"countBudgetItemProp\": n, (numeric) Number of MN budget messages (local)\n"
186 " \"countBudgetItemFin\": n, (numeric) Number of MN budget finalization messages (local)\n"
187 " \"RequestedMasternodeAssets\": n, (numeric) Status code of last sync phase\n"
188 " \"RequestedMasternodeAttempt\": n, (numeric) Status code of last sync attempt\n"
191 "\nResult ('reset' mode):\n"
192 "\"status\" (string) 'success'\n"
198 if (strMode ==
"status") {
221 if (strMode ==
"reset") {
229 class DescribeAddressVisitor :
public boost::static_visitor<UniValue>
234 explicit DescribeAddressVisitor(
CWallet *_pwallet) : pwallet(_pwallet) {}
241 obj.pushKV(
"isscript",
false);
242 if (pwallet && pwallet->
GetPubKey(keyID, vchPubKey)) {
243 obj.pushKV(
"pubkey",
HexStr(vchPubKey));
252 obj.pushKV(
"isscript",
false);
253 if (pwallet && pwallet->
GetPubKey(keyID, vchPubKey)) {
254 obj.pushKV(
"exchangepubkey",
HexStr(vchPubKey));
262 obj.pushKV(
"isscript",
true);
264 if (pwallet && pwallet->
GetCScript(scriptID, subscript)) {
265 std::vector<CTxDestination> addresses;
270 obj.pushKV(
"hex",
HexStr(subscript));
274 obj.pushKV(
"addresses", a);
276 obj.pushKV(
"sigsrequired", nRequired);
318 throw std::runtime_error(
319 "spork \"name\" ( value )\n"
320 "\nReturn spork values or their active state.\n"
323 "1. \"name\" (string, required) \"show\" to show values, \"active\" to show active state.\n"
324 " When set up as a spork signer, the name of the spork can be used to update it's value.\n"
325 "2. value (numeric, required when updating a spork) The new value for the spork.\n"
329 " \"spork_name\": nnn (key/value) Key is the spork name, value is it's current value.\n"
333 "\nResult (active):\n"
335 " \"spork_name\": true|false (key/value) Key is the spork name, value is a boolean for it's active state.\n"
340 " \"success|failure\" (string) Whether or not the update succeeded.\n"
347 typedef boost::variant<libzcash::InvalidEncoding, libzcash::SaplingPaymentAddress, CTxDestination>
PPaymentAddress;
377 UniValue detail = boost::apply_visitor(DescribeAddressVisitor(
pwallet), dest);
395 throw std::runtime_error(
396 "validateaddress \"pivxaddress\"\n"
397 "\nReturn information about the given pivx address.\n"
400 "1. \"pivxaddress\" (string, required) The pivx address to validate\n"
404 " \"isvalid\" : true|false, (boolean) If the address is valid or not. If not, this is the only property returned.\n"
405 " \"address\" : \"pivxaddress\", (string) The pivx address validated\n"
406 " \"scriptPubKey\" : \"hex\", (string) The hex encoded scriptPubKey generated by the address -only if is standard address-\n"
407 " \"ismine\" : true|false, (boolean) If the address is yours or not\n"
408 " \"isstaking\" : true|false, (boolean) If the address is a staking address for PIVX cold staking -only if is standard address-\n"
409 " \"iswatchonly\" : true|false, (boolean) If the address is watchonly -only if standard address-\n"
410 " \"isscript\" : true|false, (boolean) If the key is a script -only if standard address-\n"
411 " \"hex\" : \"hex\", (string, optional) The redeemscript for the P2SH address -only if standard address-\n"
412 " \"pubkey\" : \"publickeyhex\", (string) The hex value of the raw public key -only if standard address-\n"
413 " \"iscompressed\" : true|false, (boolean) If the address is compressed -only if standard address-\n"
414 " \"label\" : \"label\" (string) The label associated with the address, \"\" is the default label\n"
416 " \"diversifier\" : \"hex\", (string) [sapling] The hex value of the diversifier, d -only if is sapling address-\n"
417 " \"diversifiedtransmissionkey\" : \"hex\", (string) [sapling] The hex value of pk_d -only if is sapling address-\n"
421 HelpExampleCli(
"validateaddress",
"\"DMJRSsuU9zfyrvxVaAEFQqK4MxZg6vgeS6\"") +
422 HelpExampleCli(
"validateaddress",
"\"ps1ra969yfhvhp73rw5ak2xvtcm9fkuqsnmad7qln79mphhdrst3lwu9vvv03yuyqlh42p42st47qd\"") +
423 HelpExampleRpc(
"validateaddress",
"\"DMJRSsuU9zfyrvxVaAEFQqK4MxZg6vgeS6\""));
434 bool isStaking =
false;
435 bool isExchange =
false;
448 ret.
pushKV(
"isvalid", isValid);
450 ret.
pushKV(
"address", strAddress);
463 int nRequired = params[0].
get_int();
468 throw std::runtime_error(
"a multisignature address must require at least one key to redeem");
469 if ((
int)keys.
size() < nRequired)
470 throw std::runtime_error(
472 "(got %u keys, but need at least %d to redeem)",
473 keys.
size(), nRequired));
474 if (keys.
size() > 16)
475 throw std::runtime_error(
"Number of addresses involved in the multisignature address creation > 16\nReduce the number");
476 std::vector<CPubKey> pubkeys;
477 pubkeys.resize(keys.
size());
478 for (
unsigned int i = 0; i < keys.
size(); i++) {
479 const std::string& ks = keys[i].
get_str();
484 const CKeyID* keyID = boost::get<CKeyID>(&dest);
486 throw std::runtime_error(
487 strprintf(
"%s does not refer to a key", ks));
490 if (!pwallet->
GetPubKey(*keyID, vchPubKey))
491 throw std::runtime_error(
492 strprintf(
"no full public key for address %s", ks));
494 throw std::runtime_error(
" Invalid public key: " + ks);
495 pubkeys[i] = vchPubKey;
504 throw std::runtime_error(
" Invalid public key: " + ks);
505 pubkeys[i] = vchPubKey;
507 throw std::runtime_error(
" Invalid public key: " + ks);
512 if (result.
size() > MAX_SCRIPT_ELEMENT_SIZE)
513 throw std::runtime_error(
514 strprintf(
"redeemScript exceeds size limit: %d > %d", result.
size(), MAX_SCRIPT_ELEMENT_SIZE));
524 throw std::runtime_error(
525 "createmultisig nrequired [\"key\",...]\n"
526 "\nCreates a multi-signature address with n signature of m keys required.\n"
527 "It returns a json object with the address and redeemScript.\n"
530 "1. nrequired (numeric, required) The number of required signatures out of the n keys or addresses.\n"
531 "2. \"keys\" (string, required) A json array of keys which are pivx addresses or hex-encoded public keys\n"
533 " \"key\" (string) pivx address or hex-encoded public key\n"
539 " \"address\":\"multisigaddress\", (string) The value of the new multisig address.\n"
540 " \"redeemScript\":\"script\" (string) The string value of the hex-encoded redemption script.\n"
544 "\nCreate a multisig address from 2 addresses\n" +
545 HelpExampleCli(
"createmultisig",
"2 \"[\\\"DMJRSsuU9zfyrvxVaAEFQqK4MxZg6vgeS6\\\",\\\"DAD3Y6ivr8nPQLT1NEPX84DxGCw9jz9Jvg\\\"]\"") +
546 "\nAs a json rpc call\n" +
547 HelpExampleRpc(
"createmultisig",
"2, \"[\\\"DMJRSsuU9zfyrvxVaAEFQqK4MxZg6vgeS6\\\",\\\"DAD3Y6ivr8nPQLT1NEPX84DxGCw9jz9Jvg\\\"]\""));
563 throw std::runtime_error(
564 "verifymessage \"pivxaddress\" \"signature\" \"message\"\n"
565 "\nVerify a signed message\n"
568 "1. \"pivxaddress\" (string, required) The pivx address to use for the signature.\n"
569 "2. \"signature\" (string, required) The signature provided by the signer in base 64 encoding (see signmessage).\n"
570 "3. \"message\" (string, required) The message that was signed.\n"
573 "true|false (boolean) If the signature is verified or not.\n"
576 "\nUnlock the wallet for 30 seconds\n" +
578 "\nCreate the signature\n" +
579 HelpExampleCli(
"signmessage",
"\"DAD3Y6ivr8nPQLT1NEPX84DxGCw9jz9Jvg\" \"my message\"") +
580 "\nVerify the signature\n" +
581 HelpExampleCli(
"verifymessage",
"\"DAD3Y6ivr8nPQLT1NEPX84DxGCw9jz9Jvg\" \"signature\" \"my message\"") +
583 HelpExampleRpc(
"verifymessage",
"\"DAD3Y6ivr8nPQLT1NEPX84DxGCw9jz9Jvg\", \"signature\", \"my message\""));
595 const CKeyID* keyID = boost::get<CKeyID>(&destination);
600 bool fInvalid =
false;
601 std::vector<unsigned char> vchSig =
DecodeBase64(strSign.c_str(), &fInvalid);
606 std::string strError;
613 throw std::runtime_error(
614 "setmocktime timestamp\n"
615 "\nSet the local time to given timestamp (-regtest only)\n"
618 "1. timestamp (numeric, required) Unix seconds-since-epoch timestamp\n"
619 " Pass 0 to go back to using the system time.");
621 if (!
Params().IsRegTestNet())
622 throw std::runtime_error(
"setmocktime for regression testing (-regtest mode) only");
639 for (
unsigned int i = 0; i < cats.
size(); ++i) {
640 std::string cat = cats[i].
get_str();
657 throw std::runtime_error(
658 "logging [include,...] ( [exclude,...] )\n"
659 "Gets and sets the logging configuration.\n"
660 "When called without an argument, returns the list of categories that are currently being debug logged.\n"
661 "When called with arguments, adds or removes categories from debug logging.\n"
663 "libevent logging is configured on startup and cannot be modified by this RPC during runtime."
666 "1. \"include\" (array of strings) add debug logging for these categories.\n"
667 "2. \"exclude\" (array of strings) remove debug logging for these categories.\n"
670 "{ (object): a JSON object of the logging categories that are active.\n"
671 " \"category\": fEnabled, (key/value) Key is the category name, value is a boolean of it's active state.\n"
676 +
HelpExampleCli(
"logging",
"\"[\\\"all\\\"]\" \"[\\\"http\\\"]\"")
690 uint32_t changed_log_categories = original_log_categories ^ updated_log_categories;
708 for (
const auto& logCatActive : vLogCatActive) {
709 result.
pushKV(logCatActive.category, logCatActive.active);
715 static UniValue RPCLockedMemoryInfo()
719 obj.pushKV(
"used", uint64_t(stats.
used));
720 obj.pushKV(
"free", uint64_t(stats.
free));
721 obj.pushKV(
"total", uint64_t(stats.
total));
722 obj.pushKV(
"locked", uint64_t(stats.
locked));
723 obj.pushKV(
"chunks_used", uint64_t(stats.
chunks_used));
724 obj.pushKV(
"chunks_free", uint64_t(stats.
chunks_free));
734 throw std::runtime_error(
736 "Returns an object containing information about memory usage.\n"
739 " \"locked\": { (json object) Information about locked memory manager\n"
740 " \"used\": xxxxx, (numeric) Number of bytes used\n"
741 " \"free\": xxxxx, (numeric) Number of bytes available in current arenas\n"
742 " \"total\": xxxxxxx, (numeric) Total number of bytes managed\n"
743 " \"locked\": xxxxxx, (numeric) Amount of bytes that succeeded locking. If this number is smaller than total, locking pages failed at some point and key data could be swapped to disk.\n"
744 " \"chunks_used\": xxxxx, (numeric) Number allocated chunks\n"
745 " \"chunks_free\": xxxxx, (numeric) Number unused chunks\n"
753 obj.
pushKV(
"locked", RPCLockedMemoryInfo());
760 throw std::runtime_error(
761 "echo|echojson \"message\" ...\n"
762 "\nSimply echo back the input arguments. This command is for testing.\n"
763 "\nThe difference between echo and echojson is that echojson has argument conversion enabled in the client-side table in"
764 "pivx-cli and the GUI. There is no server-side difference."
788 throw std::runtime_error(
789 "mnconnect \"op_type\" (\"[pro_tx_hash, pro_tx_hash,..]\" llmq_type \"quorum_hash\")\n"
790 "\nAdd manual quorum members connections for internal testing purposes of the tier two p2p network layer\n"
794 const auto& chainparams =
Params();
795 if (!chainparams.IsRegTestNet())
796 throw std::runtime_error(
"mnconnect for regression testing (-regtest mode) only");
803 std::set<uint256> set_dmn_protxhash;
807 for (
unsigned int i = 0; i < array.size(); i++) {
823 const auto& mn_connan =
g_connman->GetTierTwoConnMan();
825 for (
const auto& protxhash : set_dmn_protxhash) {
828 mn_connan->addPendingMasternode(protxhash);
832 mn_connan->setQuorumNodes(llmq_type, quorum_hash, set_dmn_protxhash);
835 mn_connan->setMasternodeQuorumRelayMembers(llmq_type, quorum_hash, set_dmn_protxhash);
838 mn_connan->addPendingProbeConnections(set_dmn_protxhash);
851 {
"control",
"getinfo", &
getinfo,
true, {} },
853 {
"control",
"mnsync", &
mnsync,
true, {
"mode"} },
854 {
"control",
"spork", &
spork,
true, {
"name",
"value"} },
856 {
"util",
"createmultisig", &
createmultisig,
true, {
"nrequired",
"keys"} },
857 {
"util",
"logging", &
logging,
true, {
"include",
"exclude"} },
858 {
"util",
"validateaddress", &
validateaddress,
true, {
"pivxaddress"} },
859 {
"util",
"verifymessage", &
verifymessage,
true, {
"pivxaddress",
"signature",
"message"} },
862 {
"hidden",
"echo", &
echo,
true, {
"arg0",
"arg1",
"arg2",
"arg3",
"arg4",
"arg5",
"arg6",
"arg7",
"arg8",
"arg9"} },
863 {
"hidden",
"echojson", &
echo,
true, {
"arg0",
"arg1",
"arg2",
"arg3",
"arg4",
"arg5",
"arg6",
"arg7",
"arg8",
"arg9"} },
864 {
"hidden",
"setmocktime", &
setmocktime,
true, {
"timestamp"} },
865 {
"hidden",
"mnconnect", &
mnconnect,
true, {
"op_type",
"mn_list",
"llmq_type",
"quorum_hash"} },
871 for (
unsigned int vcidx = 0; vcidx <
ARRAYLEN(commands); vcidx++)
double GetDifficulty(const CBlockIndex *blockindex)
const CChainParams & Params()
Return the currently selected parameters.
bool WillLogCategory(LogFlags category) const
void EnableCategory(LogFlags flag)
uint32_t GetCategoryMask() const
void DisableCategory(LogFlags flag)
virtual bool GetCScript(const CScriptID &hash, CScript &redeemScriptOut) const
int Height() const
Return the maximal height in the chain.
bool GetPubKey(const CKeyID &address, CPubKey &vchPubKeyOut) const override
A reference to a CKey: the Hash160 of its serialized public key, special case for exchange key.
CAmount GetFeePerK() const
A reference to a CKey: the Hash160 of its serialized public key.
int RequestedMasternodeAttempt
int countMasternodeWinner
static bool VerifyMessage(const CPubKey &pubkey, const std::vector< unsigned char > &vchSig, const std::string &strMessage, std::string &strErrorRet)
Verify the message signature, returns true if successful.
An encapsulated public key.
bool IsCompressed() const
Check whether this is a compressed public key.
bool IsFullyValid() const
fully validate whether this is a valid public key (more expensive than IsValid())
PIVX RPC command dispatcher.
bool appendCommand(const std::string &name, const CRPCCommand *pcmd)
Appends a CRPCCommand to the dispatch table.
Serialized script, used inside transaction inputs and outputs.
A reference to a CScript: the Hash160 of its serialization (see script.h)
std::string ToStringIPPort() const
bool UpdateSpork(SporkId nSporkID, int64_t nValue)
SporkId GetSporkIDByName(std::string strName)
int64_t GetSporkValue(SporkId nSporkID)
bool IsSporkActive(SporkId nSporkID)
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances,...
CStakerStatus * pStakerStatus
int GetVersion()
get the current wallet format (the oldest client version guaranteed to understand this wallet)
int64_t nRelockTime
Lock Wallet Holds a timestamp at which point the wallet is scheduled (externally) to be relocked.
bool HaveSpendingKeyForPaymentAddress(const libzcash::SaplingPaymentAddress &zaddr) const
Returns true if the wallet contains the spending key.
UniValue operator()(const libzcash::SaplingPaymentAddress &zaddr) const
DescribePaymentAddressVisitor(CWallet *_pwallet, bool _isStaking)
UniValue operator()(const CTxDestination &dest) const
UniValue operator()(const libzcash::InvalidEncoding &zaddr) const
Stats stats() const
Get pool usage statistics.
static LockedPoolManager & Instance()
Return the current instance, or create it once.
bool IsBlockchainSynced() const
int64_t GetlastMasternodeWinner() const
int64_t GetlastMasternodeList() const
int64_t GetlastBudgetItem() const
const std::string & get_str() const
int64_t get_int64() const
bool pushKVs(const UniValue &obj)
const UniValue & get_array() const
bool pushKV(const std::string &key, const UniValue &val)
std::string GetHex() const
const std::string CURRENCY_UNIT
int64_t GetOldestKeyPoolTime()
size_t KeypoolCountExternalKeys()
std::string GetNameForAddressBookEntry(const CWDestination &address) const
bool HasAddressBook(const CWDestination &address) const
CAmount GetAvailableBalance(bool fIncludeDelegated=true, bool fIncludeShielded=true) const
bool UpdateHTTPServerLogging(bool enable)
Change logging level for libevent.
std::unique_ptr< CConnman > g_connman
isminetype IsMine(const CKeyStore &keystore, const CTxDestination &dest)
isminetype
IsMine() return codes.
@ ISMINE_COLD
Indicates that we have the staking key of a P2CS.
std::vector< CLogCategoryActive > ListActiveLogCategories()
Returns a vector of the active log categories.
BCLog::Logger *const g_logger
NOTE: the logger instances is leaked on exit.
std::string ListLogCategories()
Returns a string with the supported log categories.
CMasternodeSync masternodeSync
UniValue createmultisig(const JSONRPCRequest &request)
UniValue verifymessage(const JSONRPCRequest &request)
UniValue logging(const JSONRPCRequest &request)
CScript _createmultisig_redeemScript(CWallet *const pwallet, const UniValue ¶ms)
Used by addmultisigaddress / createmultisig:
UniValue validateaddress(const JSONRPCRequest &request)
void RegisterMiscRPCCommands(CRPCTable &tableRPC)
Register miscellaneous RPC commands.
UniValue getinfo(const JSONRPCRequest &request)
UniValue mnconnect(const JSONRPCRequest &request)
const char * QUORUM_MEMBERS_CONN
const char * IQR_MEMBERS_CONN
UniValue getmemoryinfo(const JSONRPCRequest &request)
UniValue setmocktime(const JSONRPCRequest &request)
UniValue getsupplyinfo(const JSONRPCRequest &request)
getinfo depends on getsupplyinfo defined in rpc/blockchain.cpp
UniValue mnsync(const JSONRPCRequest &request)
boost::variant< libzcash::InvalidEncoding, libzcash::SaplingPaymentAddress, CTxDestination > PPaymentAddress
void EnableOrDisableLogCategories(UniValue cats, bool enable)
std::vector< CSporkDef > sporkDefs
UniValue echo(const JSONRPCRequest &request)
UniValue spork(const JSONRPCRequest &request)
bool IsValidPaymentAddressString(const std::string &str)
libzcash::PaymentAddress DecodePaymentAddress(const std::string &str)
bool IsValidDestination(const CWDestination &address)
std::string EncodeDestination(const CWDestination &address, const CChainParams::Base58Type addrType)
CWDestination DecodeDestination(const std::string &strAddress)
RecursiveMutex cs_main
Global state.
bool GetProxy(enum Network net, proxyType &proxyInfoOut)
UniValue JSONRPCError(int code, const std::string &message)
@ RPC_TYPE_ERROR
Server is in safe mode, and command is not allowed in safe mode.
@ RPC_INVALID_PARAMETER
Ran out of memory during operation.
@ RPC_INVALID_ADDRESS_OR_KEY
Unexpected type was passed as parameter.
CWallet * GetWalletForJSONRPCRequest(const JSONRPCRequest &request)
Figures out what wallet, if any, to use for a JSONRPCRequest.
void RPCTypeCheckArgument(const UniValue &value, const UniValueType &typeExpected)
Type-check one argument; throws JSONRPCError if wrong type given.
UniValue ValueFromAmount(const CAmount &amount)
std::string HelpExampleCli(std::string methodname, std::string args)
void RPCTypeCheck(const UniValue ¶ms, const std::list< UniValue::VType > &typesExpected, bool fAllowNull)
Type-check arguments; throws JSONRPCError if wrong type given.
uint256 ParseHashV(const UniValue &v, std::string strName)
Utilities: convert hex-encoded Values (throws error if not hex).
std::string HelpExampleRpc(std::string methodname, std::string args)
CSporkManager sporkManager
bool ExtractDestinations(const CScript &scriptPubKey, txnouttype &typeRet, std::vector< CTxDestination > &addressRet, int &nRequiredRet)
Parse a standard scriptPubKey with one or more destination addresses.
CScript GetScriptForMultisig(int nRequired, const std::vector< CPubKey > &keys)
Generate a multisig script.
const char * GetTxnOutputType(txnouttype t)
CScript GetScriptForDestination(const CTxDestination &dest)
Generate a PIVX scriptPubKey for the given CTxDestination.
boost::variant< CNoDestination, CKeyID, CScriptID, CExchangeKeyID > CTxDestination
A txout script template with a specific destination.
TierTwoSyncState g_tiertwo_sync_state
int64_t GetTimeOffset()
"Never go to sea with two chronometers; take one or three." Our three time sources are:
const UniValue NullUniValue
std::string HexStr(const Span< const uint8_t > s)
Convert a span of bytes to a lower-case hexadecimal string.
std::vector< unsigned char > ParseHex(const char *psz)
std::vector< unsigned char > DecodeBase64(const char *p, bool *pfInvalid)
bool IsHex(const std::string &str)
void SetMockTime(int64_t nMockTimeIn)
For testing.
CFeeRate minRelayTxFee
Fees smaller than this (in upiv) are considered zero fee (for relaying, mining and transaction creati...
CChain chainActive
The currently-connected chain of blocks (protected by cs_main).
CFeeRate payTxFee(DEFAULT_TRANSACTION_FEE)
Settings.
std::string GetWarnings(const std::string &strFor)