Skip to content

Commit f7e153e

Browse files
committed
[wallets] [docs] Add release notes for createwallet RPC.
1 parent 32167e8 commit f7e153e

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

doc/release-notes-pr10740.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
Dynamic loading of wallets
2-
--------------------------
1+
Dynamic loading and creation of wallets
2+
---------------------------------------
33

4-
Previously, wallets could only be loaded at startup, by specifying `-wallet` parameters on the command line or in the bitcoin.conf file. It is now possible to load wallets dynamically at runtime by calling the `loadwallet` RPC.
4+
Previously, wallets could only be loaded or created at startup, by specifying `-wallet` parameters on the command line or in the bitcoin.conf file. It is now possible to load and create wallets dynamically at runtime:
55

6-
The wallet can be specified as file/directory basename (which must be located in the `walletdir` directory), or as an absolute path to a file/directory.
6+
- Existing wallets can be loaded by calling the `loadwallet` RPC. The wallet can be specified as file/directory basename (which must be located in the `walletdir` directory), or as an absolute path to a file/directory.
7+
- New wallets can be created (and loaded) by calling the `createwallet` RPC. The provided name must not match a wallet file in the `walletdir` directory or the name of a wallet that is currently loaded.
78

8-
This feature is currently only available through the RPC interface. Wallets loaded in this way will display in the bitcoin-qt GUI.
9+
This feature is currently only available through the RPC interface.

src/wallet/rpcwallet.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3116,21 +3116,22 @@ UniValue loadwallet(const JSONRPCRequest& request)
31163116

31173117
UniValue createwallet(const JSONRPCRequest& request)
31183118
{
3119-
if (request.fHelp || request.params.size() != 1)
3119+
if (request.fHelp || request.params.size() != 1) {
31203120
throw std::runtime_error(
31213121
"createwallet \"wallet_name\"\n"
31223122
"\nCreates and loads a new wallet.\n"
31233123
"\nArguments:\n"
3124-
"1. \"wallet_name\" (string, required) The name for the new wallet.\n"
3124+
"1. \"wallet_name\" (string, required) The name for the new wallet. If this is a path, the wallet will be created at the path location.\n"
31253125
"\nResult:\n"
31263126
"{\n"
3127-
" \"name\" : <wallet_name>, (string) The wallet name if created successfully.\n"
3127+
" \"name\" : <wallet_name>, (string) The wallet name if created successfully. If the wallet was created using a full path, the wallet_name will be the full path.\n"
31283128
" \"warning\" : <warning>, (string) Warning message if wallet was not loaded cleanly.\n"
31293129
"}\n"
31303130
"\nExamples:\n"
3131-
+ HelpExampleCli("createwallet", "\"test.dat\"")
3132-
+ HelpExampleRpc("createwallet", "\"test.dat\"")
3131+
+ HelpExampleCli("createwallet", "\"testwallet\"")
3132+
+ HelpExampleRpc("createwallet", "\"testwallet\"")
31333133
);
3134+
}
31343135
std::string wallet_name = request.params[0].get_str();
31353136
std::string error;
31363137
std::string warning;
@@ -4361,7 +4362,7 @@ static const CRPCCommand commands[] =
43614362
{ "hidden", "addwitnessaddress", &addwitnessaddress, {"address","p2sh"} },
43624363
{ "wallet", "backupwallet", &backupwallet, {"destination"} },
43634364
{ "wallet", "bumpfee", &bumpfee, {"txid", "options"} },
4364-
{ "wallet", "createwallet", &createwallet, {"filename"} },
4365+
{ "wallet", "createwallet", &createwallet, {"wallet_name"} },
43654366
{ "wallet", "dumpprivkey", &dumpprivkey, {"address"} },
43664367
{ "wallet", "dumpwallet", &dumpwallet, {"filename"} },
43674368
{ "wallet", "encryptwallet", &encryptwallet, {"passphrase"} },

0 commit comments

Comments
 (0)