mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
refactor: Return BResult from restoreWallet
This commit is contained in:
@@ -569,11 +569,13 @@ public:
|
||||
options.require_existing = true;
|
||||
return MakeWallet(m_context, LoadWallet(m_context, name, true /* load_on_start */, options, status, error, warnings));
|
||||
}
|
||||
std::unique_ptr<Wallet> restoreWallet(const fs::path& backup_file, const std::string& wallet_name, bilingual_str& error, std::vector<bilingual_str>& warnings) override
|
||||
BResult<std::unique_ptr<Wallet>> restoreWallet(const fs::path& backup_file, const std::string& wallet_name, std::vector<bilingual_str>& warnings) override
|
||||
{
|
||||
DatabaseStatus status;
|
||||
|
||||
return MakeWallet(m_context, RestoreWallet(m_context, backup_file, wallet_name, /*load_on_start=*/true, status, error, warnings));
|
||||
bilingual_str error;
|
||||
BResult<std::unique_ptr<Wallet>> wallet{MakeWallet(m_context, RestoreWallet(m_context, backup_file, wallet_name, /*load_on_start=*/true, status, error, warnings))};
|
||||
if (!wallet) return error;
|
||||
return wallet;
|
||||
}
|
||||
std::string getWalletDir() override
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user