Skip to content

Commit d8f1540

Browse files
author
gregnuj
committed
skip bad tx's with env var
1 parent 9b8fdae commit d8f1540

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/collector/block/tx.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,12 @@ async function generateTxEntities(txHashes: string[], block: BlockEntity): Promi
5252
const txHashesUnique = [...new Set(txHashes)]
5353

5454
// Filter out specific string value
55-
const filteredTxHashes = txHashesUnique.filter(
56-
(txHash) => txHash !== 'BDC478F0E2D35AA8C4452A765CA4DB4031295DD3965F24FAB09821C3AFA4677B'
57-
)
55+
let badTxs: string[] = []
56+
if (process.env.BAD_TXS) {
57+
badTxs = process.env.BAD_TXS.split(',')
58+
}
59+
60+
const filteredTxHashes = txHashesUnique.filter((txHash) => !badTxs.includes(txHash))
5861

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

0 commit comments

Comments
 (0)