Skip to content

Commit 72d81c0

Browse files
mkazlauskasmirceahasegan
authored andcommitted
feat(wallet): store only latest 10 transactions
1 parent 945a108 commit 72d81c0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/wallet/src/services/TransactionsTracker.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,12 @@ const findIntersectionAndUpdateTxStore = ({
335335
localTx.blockHeader = newTx.blockHeader;
336336
}
337337
}
338-
// Skip overlapping transactions to avoid duplicates
338+
// Skip overlapping transactions to avoid duplicates.
339+
// Limit # of stored transactions to last `historicalTransactionsFetchLimit`
339340
localTransactions = deduplicateSortedArray(
340341
[...localTransactions, ...newTransactions.slice(localTxsFromSameBlock.length)],
341342
txEquals
342-
);
343+
).slice(-1 * historicalTransactionsFetchLimit);
343344
store.setAll(localTransactions);
344345
} else if (rollbackOcurred) {
345346
// This case handles rollbacks without new additions

0 commit comments

Comments
 (0)