Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/blockchain.cpp
Show First 20 Lines • Show All 321 Lines • ▼ Show 20 Lines | static UniValue waitforblock(const Config &config, | ||||
return ret; | return ret; | ||||
} | } | ||||
static UniValue waitforblockheight(const Config &config, | static UniValue waitforblockheight(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
if (request.fHelp || request.params.size() < 1 || | if (request.fHelp || request.params.size() < 1 || | ||||
request.params.size() > 2) { | request.params.size() > 2) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"waitforblockheight <height> (timeout)\n" | "waitforblockheight height ( timeout )\n" | ||||
"\nWaits for (at least) block height and returns the height and " | "\nWaits for (at least) block height and returns the height and " | ||||
"hash\n" | "hash\n" | ||||
"of the current tip.\n" | "of the current tip.\n" | ||||
"\nReturns the current block on timeout or exit.\n" | "\nReturns the current block on timeout or exit.\n" | ||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. height (required, int) Block height to wait for (int)\n" | "1. height (int, required) Block height to wait for (int)\n" | ||||
"2. timeout (int, optional, default=0) Time in milliseconds to " | "2. timeout (int, optional, default=0) Time in milliseconds to " | ||||
"wait for a response. 0 indicates no timeout.\n" | "wait for a response. 0 indicates no timeout.\n" | ||||
"\nResult:\n" | "\nResult:\n" | ||||
"{ (json object)\n" | "{ (json object)\n" | ||||
" \"hash\" : { (string) The blockhash\n" | " \"hash\" : { (string) The blockhash\n" | ||||
" \"height\" : { (int) Block height\n" | " \"height\" : { (int) Block height\n" | ||||
"}\n" | "}\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
▲ Show 20 Lines • Show All 422 Lines • ▼ Show 20 Lines | static UniValue getblockhash(const Config &config, | ||||
return pblockindex->GetBlockHash().GetHex(); | return pblockindex->GetBlockHash().GetHex(); | ||||
} | } | ||||
static UniValue getblockheader(const Config &config, | static UniValue getblockheader(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
if (request.fHelp || request.params.size() < 1 || | if (request.fHelp || request.params.size() < 1 || | ||||
request.params.size() > 2) { | request.params.size() > 2) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"getblockheader \"hash\" ( verbose )\n" | "getblockheader \"blockhash\" ( verbose )\n" | ||||
"\nIf verbose is false, returns a string that is serialized, " | "\nIf verbose is false, returns a string that is serialized, " | ||||
"hex-encoded data for blockheader 'hash'.\n" | "hex-encoded data for blockheader 'hash'.\n" | ||||
"If verbose is true, returns an Object with information about " | "If verbose is true, returns an Object with information about " | ||||
"blockheader <hash>.\n" | "blockheader <hash>.\n" | ||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"hash\" (string, required) The block hash\n" | "1. \"blockhash\" (string, required) The block hash\n" | ||||
"2. verbose (boolean, optional, default=true) true for a " | "2. verbose (boolean, optional, default=true) true for a " | ||||
"json object, false for the hex encoded data\n" | "json object, false for the hex encoded data\n" | ||||
"\nResult (for verbose = true):\n" | "\nResult (for verbose = true):\n" | ||||
"{\n" | "{\n" | ||||
" \"hash\" : \"hash\", (string) the block hash (same as " | " \"hash\" : \"hash\", (string) the block hash (same as " | ||||
"provided)\n" | "provided)\n" | ||||
" \"confirmations\" : n, (numeric) The number of confirmations, " | " \"confirmations\" : n, (numeric) The number of confirmations, " | ||||
"or -1 if the block is not on the main chain\n" | "or -1 if the block is not on the main chain\n" | ||||
▲ Show 20 Lines • Show All 253 Lines • ▼ Show 20 Lines | static bool GetUTXOStats(CCoinsView *view, CCoinsStats &stats) { | ||||
stats.nDiskSize = view->EstimateSize(); | stats.nDiskSize = view->EstimateSize(); | ||||
return true; | return true; | ||||
} | } | ||||
static UniValue pruneblockchain(const Config &config, | static UniValue pruneblockchain(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
if (request.fHelp || request.params.size() != 1) { | if (request.fHelp || request.params.size() != 1) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"pruneblockchain\n" | "pruneblockchain height\n" | ||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"height\" (numeric, required) The block height to prune " | "1. \"height\" (numeric, required) The block height to prune " | ||||
"up to. May be set to a discrete height, or a unix timestamp\n" | "up to. May be set to a discrete height, or a unix timestamp\n" | ||||
" to prune blocks whose block time is at least 2 " | " to prune blocks whose block time is at least 2 " | ||||
"hours older than the provided timestamp.\n" | "hours older than the provided timestamp.\n" | ||||
"\nResult:\n" | "\nResult:\n" | ||||
"n (numeric) Height of the last block pruned.\n" | "n (numeric) Height of the last block pruned.\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
▲ Show 20 Lines • Show All 794 Lines • ▼ Show 20 Lines | UniValue unparkblock(const Config &config, const JSONRPCRequest &request) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
static UniValue getchaintxstats(const Config &config, | static UniValue getchaintxstats(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
if (request.fHelp || request.params.size() > 2) { | if (request.fHelp || request.params.size() > 2) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"getchaintxstats ( nblocks blockhash )\n" | "getchaintxstats ( nblocks \"blockhash\" )\n" | ||||
"\nCompute statistics about the total number and rate of " | "\nCompute statistics about the total number and rate of " | ||||
"transactions in the chain.\n" | "transactions in the chain.\n" | ||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. nblocks (numeric, optional) Size of the window in number " | "1. nblocks (numeric, optional) Size of the window in number " | ||||
"of blocks (default: one month).\n" | "of blocks (default: one month).\n" | ||||
"2. \"blockhash\" (string, optional) The hash of the block that " | "2. \"blockhash\" (string, optional) The hash of the block that " | ||||
"ends the window.\n" | "ends the window.\n" | ||||
"\nResult:\n" | "\nResult:\n" | ||||
▲ Show 20 Lines • Show All 487 Lines • ▼ Show 20 Lines | public: | ||||
} | } | ||||
}; | }; | ||||
static UniValue scantxoutset(const Config &config, | static UniValue scantxoutset(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
if (request.fHelp || request.params.size() < 1 || | if (request.fHelp || request.params.size() < 1 || | ||||
request.params.size() > 2) { | request.params.size() > 2) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"scantxoutset <action> ( <scanobjects> )\n" | "scantxoutset \"action\" [scanobjects,...]\n" | ||||
"\nEXPERIMENTAL warning: this call may be removed or changed in " | "\nEXPERIMENTAL warning: this call may be removed or changed in " | ||||
"future releases.\n" | "future releases.\n" | ||||
"\nScans the unspent transaction output set for entries that match " | "\nScans the unspent transaction output set for entries that match " | ||||
"certain output descriptors.\n" | "certain output descriptors.\n" | ||||
"Examples of output descriptors are:\n" | "Examples of output descriptors are:\n" | ||||
" addr(<address>) Outputs whose " | " addr(<address>) Outputs whose " | ||||
"scriptPubKey corresponds to the specified address (does not " | "scriptPubKey corresponds to the specified address (does not " | ||||
"include P2PK)\n" | "include P2PK)\n" | ||||
▲ Show 20 Lines • Show All 238 Lines • Show Last 20 Lines |