Skip to content

Commit 6d7b185

Browse files
committed
fixup! Fix bug with relevant changedTxs set
1 parent c7466a1 commit 6d7b185

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/hooks/useTransactionList.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,10 @@ export function useTransactionList(wallet: EdgeCurrencyWallet, tokenId: EdgeToke
8484
// but just overlay the new transactions over the old ones:
8585
const cleanupChanged = wallet.on('transactionsChanged', txs => {
8686
let relevant = false
87+
const existingTxidsMap = new Set<string>()
88+
streamedTxs.forEach(tx => existingTxidsMap.add(tx.txid))
8789
for (const tx of txs) {
88-
if (tx.tokenId === tokenId && streamedTxs.some(streamedTx => streamedTx.txid === tx.txid)) {
90+
if (tx.tokenId === tokenId && existingTxidsMap.has(tx.txid)) {
8991
relevant = true
9092
changedTxs.set(tx.txid, tx)
9193
}

0 commit comments

Comments
 (0)