mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-04 04:45:10 +02:00
wallet: Recompute wallet TXOs after descriptor migration
When a legacy wallet has been migrated to contain descriptors, but before the transactions have been updated to match, we need to recompute the wallet TXOs so that the transaction update will work correctly.
This commit is contained in:
@@ -3901,6 +3901,10 @@ util::Result<void> CWallet::ApplyMigrationData(WalletBatch& local_wallet_batch,
|
||||
return util::Error{_("Error: Unable to read wallet's best block locator record")};
|
||||
}
|
||||
|
||||
// Update m_txos to match the descriptors remaining in this wallet
|
||||
m_txos.clear();
|
||||
RefreshAllTXOs();
|
||||
|
||||
// Check if the transactions in the wallet are still ours. Either they belong here, or they belong in the watchonly wallet.
|
||||
// We need to go through these in the tx insertion order so that lookups to spends works.
|
||||
std::vector<Txid> txids_to_delete;
|
||||
|
||||
Reference in New Issue
Block a user