File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -579,7 +579,11 @@ UniValue dumpwallet(const JSONRPCRequest& request)
579
579
" dumpwallet \" filename\"\n "
580
580
" \n Dumps all wallet keys in a human-readable format.\n "
581
581
" \n Arguments:\n "
582
- " 1. \" filename\" (string, required) The filename\n "
582
+ " 1. \" filename\" (string, required) The filename with path (either absolute or relative to bitcoind)\n "
583
+ " \n Result:\n "
584
+ " { (json object)\n "
585
+ " \" filename\" : { (string) The filename with full absolute path\n "
586
+ " }\n "
583
587
" \n Examples:\n "
584
588
+ HelpExampleCli (" dumpwallet" , " \" test\" " )
585
589
+ HelpExampleRpc (" dumpwallet" , " \" test\" " )
@@ -590,7 +594,9 @@ UniValue dumpwallet(const JSONRPCRequest& request)
590
594
EnsureWalletIsUnlocked (pwallet);
591
595
592
596
std::ofstream file;
593
- file.open (request.params [0 ].get_str ().c_str ());
597
+ boost::filesystem::path filepath = request.params [0 ].get_str ();
598
+ filepath = boost::filesystem::absolute (filepath);
599
+ file.open (filepath.string ().c_str ());
594
600
if (!file.is_open ())
595
601
throw JSONRPCError (RPC_INVALID_PARAMETER, " Cannot open wallet dump file" );
596
602
@@ -655,7 +661,11 @@ UniValue dumpwallet(const JSONRPCRequest& request)
655
661
file << " \n " ;
656
662
file << " # End of dump\n " ;
657
663
file.close ();
658
- return NullUniValue;
664
+
665
+ UniValue reply (UniValue::VOBJ);
666
+ reply.push_back (Pair (" filename" , filepath.string ()));
667
+
668
+ return reply;
659
669
}
660
670
661
671
You can’t perform that action at this time.
0 commit comments