diff --git a/packages/ton-to-cw/src/tx-processor.ts b/packages/ton-to-cw/src/tx-processor.ts index b704192..b37b22b 100644 --- a/packages/ton-to-cw/src/tx-processor.ts +++ b/packages/ton-to-cw/src/tx-processor.ts @@ -84,9 +84,15 @@ export default class TonTxProcessor { (tx) => tx.tx.hash().toString("hex") === this.latestProcessedTxHash ); if (indexOf === -1) { + const oldestTx = txs[txs.length - 1].tx; + if (!oldestTx.prevTransactionHash) { + this.logger.error( + "TonTxProcessor queryUnprocessedTransactions new offset hash is undefined" + ); + continue; + } transactions.push(...txs); // increase offset and continue querying txs until we find our oldest transaction that we can remember - const oldestTx = txs[txs.length - 1].tx; offset = { hash: oldestTx.prevTransactionHash.toString(16), lt: oldestTx.prevTransactionLt.toString(10),