diff options
author | Andrew Chow <github@achow101.com> | 2023-06-13 15:04:22 -0400 |
---|---|---|
committer | Andrew Chow <github@achow101.com> | 2023-06-13 19:00:58 -0400 |
commit | 5b3a85b4c6ffd1f29a917d4c1af4bff6c0ea2ef5 (patch) | |
tree | 52a42c6fc605d9028694eff64ec6e2254ae8e2da /src/interfaces | |
parent | da494186f2c0863a294029a5af9c4b57aeb03b40 (diff) | |
download | bitcoin-5b3a85b4c6ffd1f29a917d4c1af4bff6c0ea2ef5.tar.xz |
interfaces, wallet: Expose migrate wallet
Diffstat (limited to 'src/interfaces')
-rw-r--r-- | src/interfaces/wallet.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/interfaces/wallet.h b/src/interfaces/wallet.h index 8c31112fc9..54eb720d02 100644 --- a/src/interfaces/wallet.h +++ b/src/interfaces/wallet.h @@ -50,6 +50,7 @@ struct WalletBalances; struct WalletTx; struct WalletTxOut; struct WalletTxStatus; +struct WalletMigrationResult; using WalletOrderForm = std::vector<std::pair<std::string, std::string>>; using WalletValueMap = std::map<std::string, std::string>; @@ -332,6 +333,9 @@ public: //! 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; + //! Migrate a wallet + virtual util::Result<WalletMigrationResult> migrateWallet(const std::string& name, const SecureString& passphrase) = 0; + //! Return available wallets in wallet directory. virtual std::vector<std::string> listWalletDir() = 0; @@ -423,6 +427,15 @@ struct WalletTxOut bool is_spent = false; }; +//! Migrated wallet info +struct WalletMigrationResult +{ + std::unique_ptr<Wallet> wallet; + std::optional<std::string> watchonly_wallet_name; + std::optional<std::string> solvables_wallet_name; + fs::path backup_path; +}; + //! Return implementation of Wallet interface. This function is defined in //! dummywallet.cpp and throws if the wallet component is not compiled. std::unique_ptr<Wallet> MakeWallet(wallet::WalletContext& context, const std::shared_ptr<wallet::CWallet>& wallet); |