Use block JSON tx hashes in indexer

This commit is contained in:
Codex Bot
2026-03-24 01:04:24 +01:00
parent 08a8e6b57b
commit a6d8178100

View File

@@ -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}`);