Skip to content
Permalink
Browse files

deduplicate transactionso

  • Loading branch information...
SebastienGllmt committed Oct 10, 2019
1 parent 371cbb9 commit 4fda323c3717b6d4722ecfed6bfa0e7d55d6afd5
Showing with 10 additions and 2 deletions.
  1. +10 −2 app/api/ada/lib/state-fetch/batchedFetcher.js
@@ -207,8 +207,16 @@ export function batchGetTransactionsHistoryForAddresses(
)
)
);
// TODO: deduplicate
return transactions;
const seenTxIds = new Set();
const deduplicated = [];
for (const tx of transactions) {
if (seenTxIds.has(tx.hash)) {
continue;
}
deduplicated.push(tx);
seenTxIds.add(tx.hash);
}
return deduplicated;
} catch (error) {
Logger.error('batchedFetcher::batchGetTransactionsHistoryForAddresses error: ' + stringifyError(error));
throw new GetTxHistoryForAddressesApiError();

0 comments on commit 4fda323

Please sign in to comment.
You can’t perform that action at this time.