diff options
author | w0xlt <94266259+w0xlt@users.noreply.github.com> | 2021-12-14 19:18:56 -0300 |
---|---|---|
committer | w0xlt <94266259+w0xlt@users.noreply.github.com> | 2021-12-14 19:18:56 -0300 |
commit | 4807f73f48f4ff1084fcf7aee94e5b14592bfda8 (patch) | |
tree | 7761551b1159c35a4bed0ccf5a97d5f77650f0df /src/wallet/interfaces.cpp | |
parent | f727d814bd8df5a5346c128dd4573e457c1970e1 (diff) |
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.
Diffstat (limited to 'src/wallet/interfaces.cpp')
-rw-r--r-- | src/wallet/interfaces.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/wallet/interfaces.cpp b/src/wallet/interfaces.cpp index 6c9d0ca132..bba909b807 100644 --- a/src/wallet/interfaces.cpp +++ b/src/wallet/interfaces.cpp @@ -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()); |