@@ -2202,7 +2202,11 @@ static RPCHelpMan savemempool()
22022202 return RPCHelpMan{" savemempool" ,
22032203 " \n Dumps the mempool to disk. It will fail until the previous dump is fully loaded.\n " ,
22042204 {},
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+ }},
22062210 RPCExamples{
22072211 HelpExampleCli (" savemempool" , " " )
22082212 + HelpExampleRpc (" savemempool" , " " )
@@ -2211,6 +2215,8 @@ static RPCHelpMan savemempool()
22112215{
22122216 const CTxMemPool& mempool = EnsureAnyMemPool (request.context );
22132217
2218+ const NodeContext& node = EnsureAnyNodeContext (request.context );
2219+
22142220 if (!mempool.IsLoaded ()) {
22152221 throw JSONRPCError (RPC_MISC_ERROR, " The mempool was not loaded yet" );
22162222 }
@@ -2219,7 +2225,10 @@ static RPCHelpMan savemempool()
22192225 throw JSONRPCError (RPC_MISC_ERROR, " Unable to dump mempool to disk" );
22202226 }
22212227
2222- return NullUniValue;
2228+ UniValue ret (UniValue::VOBJ);
2229+ ret.pushKV (" filename" , fs::PathToString (node.args ->GetDataDirNet () / " mempool.dat" ));
2230+
2231+ return ret;
22232232},
22242233 };
22252234}
0 commit comments