Skip to content

Commit

Permalink
skip bad tx's with env var
Browse files Browse the repository at this point in the history
  • Loading branch information
gregnuj committed Jun 24, 2023
1 parent 9b8fdae commit d8f1540
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/collector/block/tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@ async function generateTxEntities(txHashes: string[], block: BlockEntity): Promi
const txHashesUnique = [...new Set(txHashes)]

// Filter out specific string value
const filteredTxHashes = txHashesUnique.filter(
(txHash) => txHash !== 'BDC478F0E2D35AA8C4452A765CA4DB4031295DD3965F24FAB09821C3AFA4677B'
)
let badTxs: string[] = []
if (process.env.BAD_TXS) {
badTxs = process.env.BAD_TXS.split(',')
}

const filteredTxHashes = txHashesUnique.filter((txHash) => !badTxs.includes(txHash))

return Bluebird.map(filteredTxHashes, (txHash) => lcd.getTx(txHash).then((tx) => generateTxEntity(tx, block)))
}
Expand Down

0 comments on commit d8f1540

Please sign in to comment.