Skip to content

Commit 3472d7c

Browse files
committed
Fix bug with relevant changedTxs set
Only transactions that have been streamed are relevant for the changedTxs set because we _always_ stomp the changed tx onto the streamedTxs array.
1 parent 223db71 commit 3472d7c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- changed: Replace Thorchain Savers quoting with an information modal about the shutdown.
1515
- fixed: Show correct staked balance for deprecated Velodrome pools
1616
- fixed: Crash when retrieving `exchangeRates` in some situations when no internet is available
17+
- fixed: Transaction metadata loading bugs.
1718

1819
## 4.21.1 (2025-01-28)
1920

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 existingTxidsSet = new Set<string>()
88+
streamedTxs.forEach(tx => existingTxidsSet.add(tx.txid))
8789
for (const tx of txs) {
88-
if (tx.tokenId === tokenId) {
90+
if (tx.tokenId === tokenId && existingTxidsSet.has(tx.txid)) {
8991
relevant = true
9092
changedTxs.set(tx.txid, tx)
9193
}

0 commit comments

Comments
 (0)