Requirement: The wallet provided to this function must be isolated, with no attachment to the node's context.
Declared in <wallet/wallet.h>
[[nodiscard]]
util::Result<MigrationResult>
MigrateLegacyToDescriptor(
std::shared_ptr<CWallet> local_wallet,
SecureString const& passphrase,
WalletContext& context,
bool load_wallet = true);
The migration result, or an error on failure.
The return value should not be discarded.
| Name | Description |
|---|---|
| local_wallet | The isolated wallet to migrate. |
| passphrase | The passphrase to unlock an encrypted wallet. |
| context | The wallet context to migrate within. |
| load_wallet | Whether to load the migrated wallet afterward. |