Skip to content

Commit ca6aa0b

Browse files
committed
doc: loadwallet loads from relative walletdir
Improves the documentation of help output for loadwallet to clarify that filename is relative to the default wallet directory. Adds examples that get a wallet from sub-directories.
1 parent 43e287b commit ca6aa0b

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/wallet/rpc/wallet.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ static RPCHelpMan loadwallet()
220220
"\nNote that all wallet command-line options used when starting bitcoind will be"
221221
"\napplied to the new wallet.\n",
222222
{
223-
{"filename", RPCArg::Type::STR, RPCArg::Optional::NO, "The wallet directory or .dat file."},
223+
{"filename", RPCArg::Type::STR, RPCArg::Optional::NO, "The path to the directory of the wallet to be loaded, either absolute or relative to the \"wallets\" directory. The \"wallets\" directory is set by the -walletdir option and defaults to the \"wallets\" folder within the data directory."},
224224
{"load_on_startup", RPCArg::Type::BOOL, RPCArg::Optional::OMITTED, "Save wallet name to persistent settings and load on startup. True to add wallet to startup list, false to remove, null to leave unchanged."},
225225
},
226226
RPCResult{
@@ -234,8 +234,15 @@ static RPCHelpMan loadwallet()
234234
}
235235
},
236236
RPCExamples{
237-
HelpExampleCli("loadwallet", "\"test.dat\"")
238-
+ HelpExampleRpc("loadwallet", "\"test.dat\"")
237+
"\nLoad wallet from the wallet dir:\n"
238+
+ HelpExampleCli("loadwallet", "\"walletname\"")
239+
+ HelpExampleRpc("loadwallet", "\"walletname\"")
240+
+ "\nLoad wallet using absolute path (Unix):\n"
241+
+ HelpExampleCli("loadwallet", "\"/path/to/walletname/\"")
242+
+ HelpExampleRpc("loadwallet", "\"/path/to/walletname/\"")
243+
+ "\nLoad wallet using absolute path (Windows):\n"
244+
+ HelpExampleCli("loadwallet", "\"DriveLetter:\\path\\to\\walletname\\\"")
245+
+ HelpExampleRpc("loadwallet", "\"DriveLetter:\\path\\to\\walletname\\\"")
239246
},
240247
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
241248
{

0 commit comments

Comments
 (0)