wallet: prune rediscovered spent silent outputs

This commit is contained in:
lemon
2026-06-01 15:13:24 -07:00
parent 32b477bd01
commit 4e9da2d168
+4 -1
View File
@@ -591,10 +591,13 @@ export function useHdWalletSp(): UseHdWalletSpResult {
}
const opt = optimisticRef.current!;
const spentKeys = new Set(freshArchive.map((u) => `${u.txid}:${u.vout}`));
optimisticRef.current = {
version: SP_STORAGE_VERSION,
scanHeight: opt.scanHeight,
utxos: mergeUtxos(opt.utxos, freshActive),
utxos: mergeUtxos(opt.utxos, freshActive).filter(
(u) => !spentKeys.has(`${u.txid}:${u.vout}`),
),
spent: mergeUtxos(opt.spent ?? [], freshArchive),
};
matchesFound += blockMatches.length;