diff --git a/apps/whale/src/module.indexer/model/dftx.indexer.ts b/apps/whale/src/module.indexer/model/dftx.indexer.ts index cd18c0e3ce..d76e2a0a69 100644 --- a/apps/whale/src/module.indexer/model/dftx.indexer.ts +++ b/apps/whale/src/module.indexer/model/dftx.indexer.ts @@ -47,7 +47,7 @@ export class MainDfTxIndexer extends Indexer { } } -function getDfTxTransactions (block: RawBlock): Array> { +export function getDfTxTransactions (block: RawBlock): Array> { const transactions: Array> = [] for (const txn of block.tx) { @@ -56,9 +56,10 @@ function getDfTxTransactions (block: RawBlock): Array> { continue } - const stack: OPCode[] = toOPCodes( - SmartBuffer.fromBuffer(Buffer.from(vout.scriptPubKey.hex, 'hex')) - ) + const stack: OPCode[] = toOPCodes(SmartBuffer.fromBuffer(Buffer.from(vout.scriptPubKey.hex, 'hex'))) + if (stack[1].type !== 'OP_DEFI_TX') { + continue + } transactions.push({ txn: txn, dftx: (stack[1] as OP_DEFI_TX).tx }) } }