wallet, interfaces, gui: Expose load_after_restore parameter
RestoreWallet has a load_after_restore parameter, expose this to callers using it through the wallet interface as well.
This commit is contained in:
1 parent
d155fc12a0
commit
4ec2d18a07
3 files changed
+6
-7
No files matched your search
@@ -325,7 +325,7 @@ public:
|
|||||||
virtual std::string getWalletDir() = 0;
|
virtual std::string getWalletDir() = 0;
|
||||||
|
|
||||||
//! Restore backup wallet
|
//! Restore backup wallet
|
||||||
virtual util::Result<std::unique_ptr<Wallet>> restoreWallet(const fs::path& backup_file, const std::string& wallet_name, std::vector<bilingual_str>& warnings) = 0;
|
virtual util::Result<std::unique_ptr<Wallet>> restoreWallet(const fs::path& backup_file, const std::string& wallet_name, std::vector<bilingual_str>& warnings, bool load_after_restore) = 0;
|
||||||
|
|
||||||
//! Migrate a wallet
|
//! Migrate a wallet
|
||||||
virtual util::Result<WalletMigrationResult> migrateWallet(const std::string& name, const SecureString& passphrase) = 0;
|
virtual util::Result<WalletMigrationResult> migrateWallet(const std::string& name, const SecureString& passphrase) = 0;
|
||||||
|
|||||||
@@ -409,7 +409,7 @@ void RestoreWalletActivity::restore(const fs::path& backup_file, const std::stri
|
|||||||
tr("Restoring Wallet <b>%1</b>…").arg(name.toHtmlEscaped()));
|
tr("Restoring Wallet <b>%1</b>…").arg(name.toHtmlEscaped()));
|
||||||
|
|
||||||
QTimer::singleShot(0, worker(), [this, backup_file, wallet_name] {
|
QTimer::singleShot(0, worker(), [this, backup_file, wallet_name] {
|
||||||
auto wallet{node().walletLoader().restoreWallet(backup_file, wallet_name, m_warning_message)};
|
auto wallet{node().walletLoader().restoreWallet(backup_file, wallet_name, m_warning_message, /*load_after_restore=*/true)};
|
||||||
|
|
||||||
if (wallet) {
|
if (wallet) {
|
||||||
m_wallet_model = m_wallet_controller->getOrCreateWallet(std::move(*wallet));
|
m_wallet_model = m_wallet_controller->getOrCreateWallet(std::move(*wallet));
|
||||||
|
|||||||
@@ -597,16 +597,15 @@ public:
|
|||||||
return util::Error{error};
|
return util::Error{error};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
util::Result<std::unique_ptr<Wallet>> restoreWallet(const fs::path& backup_file, const std::string& wallet_name, std::vector<bilingual_str>& warnings) override
|
util::Result<std::unique_ptr<Wallet>> restoreWallet(const fs::path& backup_file, const std::string& wallet_name, std::vector<bilingual_str>& warnings, bool load_after_restore) override
|
||||||
{
|
{
|
||||||
DatabaseStatus status;
|
DatabaseStatus status;
|
||||||
bilingual_str error;
|
bilingual_str error;
|
||||||
std::unique_ptr<Wallet> wallet{MakeWallet(m_context, RestoreWallet(m_context, backup_file, wallet_name, /*load_on_start=*/true, status, error, warnings))};
|
std::unique_ptr<Wallet> wallet{MakeWallet(m_context, RestoreWallet(m_context, backup_file, wallet_name, /*load_on_start=*/true, status, error, warnings, load_after_restore))};
|
||||||
if (wallet) {
|
if (!error.empty()) {
|
||||||
return wallet;
|
|
||||||
} else {
|
|
||||||
return util::Error{error};
|
return util::Error{error};
|
||||||
}
|
}
|
||||||
|
return wallet;
|
||||||
}
|
}
|
||||||
util::Result<WalletMigrationResult> migrateWallet(const std::string& name, const SecureString& passphrase) override
|
util::Result<WalletMigrationResult> migrateWallet(const std::string& name, const SecureString& passphrase) override
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user