aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2020-08-04 21:03:27 -0400
committerRussell Yanofsky <russ@yanofsky.org>2020-09-03 12:24:32 -0400
commit77d5bb72b8722ec7a6c7c33479a532cbd5870ba4 (patch)
tree84b7820a100705154d6635483486aaa119b9fa43 /src
parenta987438e9d9cad0b5530e218a447928485f3fd93 (diff)
wallet: Remove path checking code from createwallet RPC
This commit does not change behavior except for error messages which now include more complete information.
Diffstat (limited to 'src')
-rw-r--r--src/wallet/rpcwallet.cpp1
-rw-r--r--src/wallet/wallet.cpp7
2 files changed, 1 insertions, 7 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
index 497a4120e5..891d650ad3 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -2647,6 +2647,7 @@ static UniValue createwallet(const JSONRPCRequest& request)
DatabaseOptions options;
DatabaseStatus status;
+ options.require_create = true;
options.create_flags = flags;
options.create_passphrase = passphrase;
bilingual_str error;
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 1751cbf5bc..0d07904924 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -253,13 +253,6 @@ std::shared_ptr<CWallet> CreateWallet(interfaces::Chain& chain, const std::strin
wallet_creation_flags |= WALLET_FLAG_BLANK_WALLET;
}
- // Check the wallet file location
- if (fs::symlink_status(fs::absolute(name.empty() ? "wallet.dat" : name, GetWalletDir())).type() != fs::file_not_found) {
- error = strprintf(Untranslated("Wallet %s already exists."), name);
- status = DatabaseStatus::FAILED_CREATE;
- return nullptr;
- }
-
// Wallet::Verify will check if we're trying to create a wallet with a duplicate name.
std::unique_ptr<WalletDatabase> database = MakeWalletDatabase(name, options, status, error);
if (!database) {