aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonas Schnelli <dev@jonasschnelli.ch>2020-10-20 17:48:20 +0200
committerJonas Schnelli <dev@jonasschnelli.ch>2020-11-03 12:06:32 +0100
commit58cfbc38e040925b51cb8d35d23b50e9cf06fb2a (patch)
treee20554788b8e71da2607eb9f07b692949a056528 /src
parent218fe60d91a9190aa0ee561479044df368214766 (diff)
Ignoring (but warn) on duplicate -wallet parameters
Diffstat (limited to 'src')
-rw-r--r--src/wallet/load.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/wallet/load.cpp b/src/wallet/load.cpp
index 1cdcb35fc7..036fd4956f 100644
--- a/src/wallet/load.cpp
+++ b/src/wallet/load.cpp
@@ -65,8 +65,8 @@ bool VerifyWallets(interfaces::Chain& chain)
const fs::path path = fs::absolute(wallet_file, GetWalletDir());
if (!wallet_paths.insert(path).second) {
- chain.initError(strprintf(_("Error loading wallet %s. Duplicate -wallet filename specified."), wallet_file));
- return false;
+ chain.initWarning(strprintf(_("Ignoring duplicate -wallet %s."), wallet_file));
+ continue;
}
DatabaseOptions options;
@@ -90,7 +90,11 @@ bool VerifyWallets(interfaces::Chain& chain)
bool LoadWallets(interfaces::Chain& chain)
{
try {
+ std::set<fs::path> wallet_paths;
for (const std::string& name : gArgs.GetArgs("-wallet")) {
+ if (!wallet_paths.insert(name).second) {
+ continue;
+ }
DatabaseOptions options;
DatabaseStatus status;
options.require_existing = true;