Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/blockchain.cpp
Show First 20 Lines • Show All 1,842 Lines • ▼ Show 20 Lines | UniValue getchaintxstats(const Config &config, const JSONRPCRequest &request) { | ||||
} | } | ||||
return ret; | return ret; | ||||
} | } | ||||
UniValue savemempool(const Config &config, const JSONRPCRequest &request) { | UniValue savemempool(const Config &config, const JSONRPCRequest &request) { | ||||
if (request.fHelp || request.params.size() != 0) { | if (request.fHelp || request.params.size() != 0) { | ||||
throw std::runtime_error("savemempool\n" | throw std::runtime_error("savemempool\n" | ||||
"\nDumps the mempool to disk.\n" | "\nDumps the mempool to disk. It will fail " | ||||
"until the previous dump is fully loaded.\n" | |||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("savemempool", "") + | HelpExampleCli("savemempool", "") + | ||||
HelpExampleRpc("savemempool", "")); | HelpExampleRpc("savemempool", "")); | ||||
} | } | ||||
if (!g_is_mempool_loaded) { | |||||
throw JSONRPCError(RPC_MISC_ERROR, "The mempool was not loaded yet"); | |||||
} | |||||
if (!DumpMempool()) { | if (!DumpMempool()) { | ||||
throw JSONRPCError(RPC_MISC_ERROR, "Unable to dump mempool to disk"); | throw JSONRPCError(RPC_MISC_ERROR, "Unable to dump mempool to disk"); | ||||
} | } | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
// clang-format off | // clang-format off | ||||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |