Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/blockchain.cpp
Show First 20 Lines • Show All 1,658 Lines • ▼ Show 20 Lines | if (blockcount > 0) { | ||||
} | } | ||||
} | } | ||||
return ret; | return ret; | ||||
} | } | ||||
// clang-format off | // clang-format off | ||||
static const ContextFreeRPCCommand commands[] = { | static const ContextFreeRPCCommand commands[] = { | ||||
// category name actor (function) okSafe argNames | // category name actor (function) argNames | ||||
// ------------------- ------------------------ ---------------------- ------ ---------- | // ------------------- ------------------------ ---------------------- ---------- | ||||
{ "blockchain", "getblockchaininfo", getblockchaininfo, true, {} }, | { "blockchain", "getblockchaininfo", getblockchaininfo, {} }, | ||||
{ "blockchain", "getchaintxstats", &getchaintxstats, true, {"nblocks", "blockhash"} }, | { "blockchain", "getchaintxstats", &getchaintxstats, {"nblocks", "blockhash"} }, | ||||
{ "blockchain", "getbestblockhash", getbestblockhash, true, {} }, | { "blockchain", "getbestblockhash", getbestblockhash, {} }, | ||||
{ "blockchain", "getblockcount", getblockcount, true, {} }, | { "blockchain", "getblockcount", getblockcount, {} }, | ||||
{ "blockchain", "getblock", getblock, true, {"blockhash","verbose"} }, | { "blockchain", "getblock", getblock, {"blockhash","verbose"} }, | ||||
{ "blockchain", "getblockhash", getblockhash, true, {"height"} }, | { "blockchain", "getblockhash", getblockhash, {"height"} }, | ||||
{ "blockchain", "getblockheader", getblockheader, true, {"blockhash","verbose"} }, | { "blockchain", "getblockheader", getblockheader, {"blockhash","verbose"} }, | ||||
{ "blockchain", "getchaintips", getchaintips, true, {} }, | { "blockchain", "getchaintips", getchaintips, {} }, | ||||
{ "blockchain", "getdifficulty", getdifficulty, true, {} }, | { "blockchain", "getdifficulty", getdifficulty, {} }, | ||||
{ "blockchain", "getmempoolancestors", getmempoolancestors, true, {"txid","verbose"} }, | { "blockchain", "getmempoolancestors", getmempoolancestors, {"txid","verbose"} }, | ||||
{ "blockchain", "getmempooldescendants", getmempooldescendants, true, {"txid","verbose"} }, | { "blockchain", "getmempooldescendants", getmempooldescendants, {"txid","verbose"} }, | ||||
{ "blockchain", "getmempoolentry", getmempoolentry, true, {"txid"} }, | { "blockchain", "getmempoolentry", getmempoolentry, {"txid"} }, | ||||
{ "blockchain", "getmempoolinfo", getmempoolinfo, true, {} }, | { "blockchain", "getmempoolinfo", getmempoolinfo, {} }, | ||||
{ "blockchain", "getrawmempool", getrawmempool, true, {"verbose"} }, | { "blockchain", "getrawmempool", getrawmempool, {"verbose"} }, | ||||
{ "blockchain", "gettxout", gettxout, true, {"txid","n","include_mempool"} }, | { "blockchain", "gettxout", gettxout, {"txid","n","include_mempool"} }, | ||||
{ "blockchain", "gettxoutsetinfo", gettxoutsetinfo, true, {} }, | { "blockchain", "gettxoutsetinfo", gettxoutsetinfo, {} }, | ||||
{ "blockchain", "pruneblockchain", pruneblockchain, true, {"height"} }, | { "blockchain", "pruneblockchain", pruneblockchain, {"height"} }, | ||||
{ "blockchain", "verifychain", verifychain, true, {"checklevel","nblocks"} }, | { "blockchain", "verifychain", verifychain, {"checklevel","nblocks"} }, | ||||
{ "blockchain", "preciousblock", preciousblock, true, {"blockhash"} }, | { "blockchain", "preciousblock", preciousblock, {"blockhash"} }, | ||||
/* Not shown in help */ | /* Not shown in help */ | ||||
{ "hidden", "invalidateblock", invalidateblock, true, {"blockhash"} }, | { "hidden", "invalidateblock", invalidateblock, {"blockhash"} }, | ||||
{ "hidden", "reconsiderblock", reconsiderblock, true, {"blockhash"} }, | { "hidden", "reconsiderblock", reconsiderblock, {"blockhash"} }, | ||||
{ "hidden", "waitfornewblock", waitfornewblock, true, {"timeout"} }, | { "hidden", "waitfornewblock", waitfornewblock, {"timeout"} }, | ||||
{ "hidden", "waitforblock", waitforblock, true, {"blockhash","timeout"} }, | { "hidden", "waitforblock", waitforblock, {"blockhash","timeout"} }, | ||||
{ "hidden", "waitforblockheight", waitforblockheight, true, {"height","timeout"} }, | { "hidden", "waitforblockheight", waitforblockheight, {"height","timeout"} }, | ||||
}; | }; | ||||
// clang-format on | // clang-format on | ||||
void RegisterBlockchainRPCCommands(CRPCTable &t) { | void RegisterBlockchainRPCCommands(CRPCTable &t) { | ||||
for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++) { | for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++) { | ||||
t.appendCommand(commands[vcidx].name, &commands[vcidx]); | t.appendCommand(commands[vcidx].name, &commands[vcidx]); | ||||
} | } | ||||
} | } |