mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-01 00:34:01 +02:00
Add savemempool RPC
This commit is contained in:
@@ -1532,6 +1532,25 @@ UniValue getchaintxstats(const JSONRPCRequest& request)
|
||||
return ret;
|
||||
}
|
||||
|
||||
UniValue savemempool(const JSONRPCRequest& request)
|
||||
{
|
||||
if (request.fHelp || request.params.size() != 0) {
|
||||
throw std::runtime_error(
|
||||
"savemempool\n"
|
||||
"\nDumps the mempool to disk.\n"
|
||||
"\nExamples:\n"
|
||||
+ HelpExampleCli("savemempool", "")
|
||||
+ HelpExampleRpc("savemempool", "")
|
||||
);
|
||||
}
|
||||
|
||||
if (!DumpMempool()) {
|
||||
throw JSONRPCError(RPC_MISC_ERROR, "Unable to dump mempool to disk");
|
||||
}
|
||||
|
||||
return NullUniValue;
|
||||
}
|
||||
|
||||
static const CRPCCommand commands[] =
|
||||
{ // category name actor (function) argNames
|
||||
// --------------------- ------------------------ ----------------------- ----------
|
||||
@@ -1552,6 +1571,7 @@ static const CRPCCommand commands[] =
|
||||
{ "blockchain", "gettxout", &gettxout, {"txid","n","include_mempool"} },
|
||||
{ "blockchain", "gettxoutsetinfo", &gettxoutsetinfo, {} },
|
||||
{ "blockchain", "pruneblockchain", &pruneblockchain, {"height"} },
|
||||
{ "blockchain", "savemempool", &savemempool, {} },
|
||||
{ "blockchain", "verifychain", &verifychain, {"checklevel","nblocks"} },
|
||||
|
||||
{ "blockchain", "preciousblock", &preciousblock, {"blockhash"} },
|
||||
|
||||
Reference in New Issue
Block a user