@@ -2202,7 +2202,11 @@ static RPCHelpMan savemempool()
2202
2202
return RPCHelpMan{" savemempool" ,
2203
2203
" \n Dumps the mempool to disk. It will fail until the previous dump is fully loaded.\n " ,
2204
2204
{},
2205
- RPCResult{RPCResult::Type::NONE, " " , " " },
2205
+ RPCResult{
2206
+ RPCResult::Type::OBJ, " " , " " ,
2207
+ {
2208
+ {RPCResult::Type::STR, " filename" , " the directory and file where the mempool was saved" },
2209
+ }},
2206
2210
RPCExamples{
2207
2211
HelpExampleCli (" savemempool" , " " )
2208
2212
+ HelpExampleRpc (" savemempool" , " " )
@@ -2211,6 +2215,8 @@ static RPCHelpMan savemempool()
2211
2215
{
2212
2216
const CTxMemPool& mempool = EnsureAnyMemPool (request.context );
2213
2217
2218
+ const NodeContext& node = EnsureAnyNodeContext (request.context );
2219
+
2214
2220
if (!mempool.IsLoaded ()) {
2215
2221
throw JSONRPCError (RPC_MISC_ERROR, " The mempool was not loaded yet" );
2216
2222
}
@@ -2219,7 +2225,10 @@ static RPCHelpMan savemempool()
2219
2225
throw JSONRPCError (RPC_MISC_ERROR, " Unable to dump mempool to disk" );
2220
2226
}
2221
2227
2222
- return NullUniValue;
2228
+ UniValue ret (UniValue::VOBJ);
2229
+ ret.pushKV (" filename" , fs::path ((node.args ->GetDataDirNet () / " mempool.dat" )).u8string ());
2230
+
2231
+ return ret;
2223
2232
},
2224
2233
};
2225
2234
}
0 commit comments