aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2023-09-20 22:25:37 +0100
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2023-09-20 22:32:31 +0100
commit1d4846a8443be901b8a5deb0e357481af22838d0 (patch)
tree97798d559e47f142411b5c2d95d7b1a0ee4168e4 /src/interfaces
parent8247a8db6963d2116dc4697a3217d736c197f91d (diff)
parent48aae2cffeb91add75a70ac4d5075c38054452fa (diff)
downloadbitcoin-1d4846a8443be901b8a5deb0e357481af22838d0.tar.xz
Merge bitcoin-core/gui#738: Add menu option to migrate a wallet
48aae2cffeb91add75a70ac4d5075c38054452fa gui: Add File > Migrate Wallet (Andrew Chow) 577be889cd52fc2d896a5f39c66bc2cadb8622e4 gui: Optionally return passphrase after unlocking (Andrew Chow) 5b3a85b4c6ffd1f29a917d4c1af4bff6c0ea2ef5 interfaces, wallet: Expose migrate wallet (Andrew Chow) Pull request description: GUI users need to be able to migrate wallets without going to the RPC console. ACKs for top commit: jarolrod: ACK 48aae2cffeb91add75a70ac4d5075c38054452fa pablomartin4btc: tACK 48aae2cffeb91add75a70ac4d5075c38054452fa hebasto: ACK 48aae2cffeb91add75a70ac4d5075c38054452fa Tree-SHA512: 2d02b1e85e7d6cfbf503f417f150cdaa0c63822942e9a6fe28c0ad3e7f40a957bb01a375c909a60432dc600e84574881aa446c7ec983b56f0bb23f07ef15de54
Diffstat (limited to 'src/interfaces')
-rw-r--r--src/interfaces/wallet.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/interfaces/wallet.h b/src/interfaces/wallet.h
index 9987681367..209516ebcb 100644
--- a/src/interfaces/wallet.h
+++ b/src/interfaces/wallet.h
@@ -51,6 +51,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>;
@@ -333,6 +334,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;
@@ -424,6 +428,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);