mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
refactor: Implement restorewallet() logic in the wallet section
Currently restorewallet() logic is written in the RPC layer and it can´t be reused by GUI. So it reimplements this in the wallet and interface sections and then, GUI can access it.
This commit is contained in:
@@ -552,6 +552,12 @@ 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 std::string& backup_file, const std::string& wallet_name, bilingual_str& error, 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));
|
||||
}
|
||||
std::string getWalletDir() override
|
||||
{
|
||||
return fs::PathToString(GetWalletDir());
|
||||
|
||||
Reference in New Issue
Block a user