Skip to content

Commit 17d453c

Browse files
committed
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.
1 parent 764016e commit 17d453c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/wallet/wallet.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3901,6 +3901,10 @@ util::Result<void> CWallet::ApplyMigrationData(WalletBatch& local_wallet_batch,
39013901
return util::Error{_("Error: Unable to read wallet's best block locator record")};
39023902
}
39033903

3904+
// Update m_txos to match the descriptors remaining in this wallet
3905+
m_txos.clear();
3906+
RefreshAllTXOs();
3907+
39043908
// Check if the transactions in the wallet are still ours. Either they belong here, or they belong in the watchonly wallet.
39053909
// We need to go through these in the tx insertion order so that lookups to spends works.
39063910
std::vector<Txid> txids_to_delete;

0 commit comments

Comments
 (0)