Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CWallet::Create move chain init message up into calling code
Browse files Browse the repository at this point in the history
S3RK committed Jan 13, 2021
1 parent a888db2 commit 2b77279
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/wallet/load.cpp
Original file line number Diff line number Diff line change
@@ -105,6 +105,7 @@ bool LoadWallets(interfaces::Chain& chain)
if (!database && status == DatabaseStatus::FAILED_NOT_FOUND) {
continue;
}
chain.initMessage(_("Loading wallet...").translated);
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) {
4 changes: 2 additions & 2 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
@@ -210,6 +210,7 @@ std::shared_ptr<CWallet> LoadWalletInternal(interfaces::Chain& chain, const std:
return nullptr;
}

chain.initMessage(_("Loading wallet...").translated);
std::shared_ptr<CWallet> wallet = CWallet::Create(chain, name, std::move(database), options.create_flags, error, warnings);
if (!wallet) {
error = Untranslated("Wallet loading failed.") + Untranslated(" ") + error;
@@ -275,6 +276,7 @@ std::shared_ptr<CWallet> CreateWallet(interfaces::Chain& chain, const std::strin
}

// Make the wallet
chain.initMessage(_("Loading wallet...").translated);
std::shared_ptr<CWallet> wallet = CWallet::Create(chain, name, std::move(database), wallet_creation_flags, error, warnings);
if (!wallet) {
error = Untranslated("Wallet creation failed.") + Untranslated(" ") + error;
@@ -3799,8 +3801,6 @@ std::shared_ptr<CWallet> CWallet::Create(interfaces::Chain& chain, const std::st
{
const std::string& walletFile = database->Filename();

chain.initMessage(_("Loading wallet...").translated);

int64_t nStart = GetTimeMillis();
// TODO: Can't use std::make_shared because we need a custom deleter but
// should be possible to use std::allocate_shared.

0 comments on commit 2b77279

Please sign in to comment.