diff options
author | Russell Yanofsky <russ@yanofsky.org> | 2020-08-04 20:45:28 -0400 |
---|---|---|
committer | Russell Yanofsky <russ@yanofsky.org> | 2020-09-03 12:24:32 -0400 |
commit | 8b5e7297c02f3100a9cb27bfe206e3fc617ec173 (patch) | |
tree | d77b54fad59498c100511fe1565d9b06c55fe444 /src/wallet/load.cpp | |
parent | 3c815cfe54087fd139169161d2fd175e99840e6a (diff) |
refactor: Pass wallet database into CWallet::Create
No changes in behavior
Diffstat (limited to 'src/wallet/load.cpp')
-rw-r--r-- | src/wallet/load.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/wallet/load.cpp b/src/wallet/load.cpp index 84dc5adf66..c5d045e9ef 100644 --- a/src/wallet/load.cpp +++ b/src/wallet/load.cpp @@ -68,10 +68,14 @@ bool VerifyWallets(interfaces::Chain& chain, const std::vector<std::string>& wal bool LoadWallets(interfaces::Chain& chain, const std::vector<std::string>& wallet_files) { try { - for (const std::string& walletFile : wallet_files) { + for (const std::string& name : wallet_files) { + DatabaseOptions options; + DatabaseStatus status; + options.verify = false; // No need to verify, assuming verified earlier in VerifyWallets() bilingual_str error; std::vector<bilingual_str> warnings; - std::shared_ptr<CWallet> pwallet = CWallet::CreateWalletFromFile(chain, walletFile, error, warnings); + std::unique_ptr<WalletDatabase> database = MakeWalletDatabase(name, options, status, error); + std::shared_ptr<CWallet> pwallet = database ? CWallet::Create(chain, name, std::move(database), options.create_flags, error, warnings) : nullptr; if (!warnings.empty()) chain.initWarning(Join(warnings, Untranslated("\n"))); if (!pwallet) { chain.initError(error); |