From a6d81781002c077b2c563cda20fec8ba955c2e12 Mon Sep 17 00:00:00 2001 From: Codex Bot Date: Tue, 24 Mar 2026 01:04:24 +0100 Subject: [PATCH] Use block JSON tx hashes in indexer --- apps/indexer/src/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/indexer/src/index.ts b/apps/indexer/src/index.ts index 52bce9a..fc5f310 100644 --- a/apps/indexer/src/index.ts +++ b/apps/indexer/src/index.ts @@ -154,7 +154,12 @@ async function indexBlock(pool: Pool, rpc: PeyaRpcClient, height: number) { : mergeMiningTagPresent ? "detected-from-miner-tx-extra" : null; - const txHashes = [block.miner_tx_hash, block.protocol_tx_hash, ...block.tx_hashes]; + const blockTxHashes = Array.isArray(blockJson.tx_hashes) + ? blockJson.tx_hashes + : Array.isArray(block.tx_hashes) + ? block.tx_hashes + : []; + const txHashes = [block.miner_tx_hash, block.protocol_tx_hash, ...blockTxHashes]; const txResponse = await rpc.getTransactions(txHashes); if (txResponse.status !== "OK") { throw new Error(`gettransactions for block ${height} returned ${txResponse.status}`);