aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoin-cli.cpp
diff options
context:
space:
mode:
authorRussell Yanofsky <[email protected]>2017-11-15 15:44:36 -0500
committerRussell Yanofsky <[email protected]>2018-03-03 10:26:55 -0500
commitbe8ab7d082228d09ca529d1a08730d7d5aacb0ed (patch)
treed1fc152627f6c6daf32034520d51abbb2701d9ae /src/bitcoin-cli.cpp
parentAllow wallet files not in -walletdir directory (diff)
downloaddiscoin-be8ab7d082228d09ca529d1a08730d7d5aacb0ed.tar.xz
discoin-be8ab7d082228d09ca529d1a08730d7d5aacb0ed.zip
Create new wallet databases as directories rather than files
This change should make it easier for users to make complete backups of wallets because they can now just back up the specified `-wallet=<path>` path directly, instead of having to back up the specified path as well as the transaction log directory (for incompletely flushed wallets). Another advantage of this change is that if two wallets are located in the same directory, they will now use their own BerkeleyDB environments instead using a shared environment. Using a shared environment makes it difficult to manage and back up wallets separately because transaction log files will contain a mix of data from all wallets in the environment.
Diffstat (limited to 'src/bitcoin-cli.cpp')
-rw-r--r--src/bitcoin-cli.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp
index fedfcc4f1..41f1e5786 100644
--- a/src/bitcoin-cli.cpp
+++ b/src/bitcoin-cli.cpp
@@ -339,8 +339,8 @@ static UniValue CallRPC(BaseRequestHandler *rh, const std::string& strMethod, co
// check if we should use a special wallet endpoint
std::string endpoint = "/";
- std::string walletName = gArgs.GetArg("-rpcwallet", "");
- if (!walletName.empty()) {
+ if (!gArgs.GetArgs("-rpcwallet").empty()) {
+ std::string walletName = gArgs.GetArg("-rpcwallet", "");
char *encodedURI = evhttp_uriencode(walletName.c_str(), walletName.size(), false);
if (encodedURI) {
endpoint = "/wallet/"+ std::string(encodedURI);