Browse Source

Wallet: Support loading multiple wallets if -wallet used more than once

0.15
Luke Dashjr 8 years ago
parent
commit
0f08575be2
  1. 22
      src/wallet/wallet.cpp

22
src/wallet/wallet.cpp

@ -3930,19 +3930,21 @@ bool CWallet::InitLoadWallet()
return true; return true;
} }
std::string walletFile = GetArg("-wallet", DEFAULT_WALLET_DAT); SoftSetArg("-wallet", DEFAULT_WALLET_DAT);
if (boost::filesystem::path(walletFile).filename() != walletFile) { for (const std::string& walletFile : gArgs.GetArgs("-wallet")) {
return InitError(_("-wallet parameter must only specify a filename (not a path)")); if (boost::filesystem::path(walletFile).filename() != walletFile) {
} else if (SanitizeString(walletFile, SAFE_CHARS_FILENAME) != walletFile) { return InitError(_("-wallet parameter must only specify a filename (not a path)"));
return InitError(_("Invalid characters in -wallet filename")); } else if (SanitizeString(walletFile, SAFE_CHARS_FILENAME) != walletFile) {
} return InitError(_("Invalid characters in -wallet filename"));
}
CWallet * const pwallet = CreateWalletFromFile(walletFile); CWallet * const pwallet = CreateWalletFromFile(walletFile);
if (!pwallet) { if (!pwallet) {
return false; return false;
}
vpwallets.push_back(pwallet);
} }
vpwallets.push_back(pwallet);
return true; return true;
} }

Loading…
Cancel
Save