Use block JSON tx hashes in indexer
This commit is contained in:
@@ -154,7 +154,12 @@ async function indexBlock(pool: Pool, rpc: PeyaRpcClient, height: number) {
|
|||||||
: mergeMiningTagPresent
|
: mergeMiningTagPresent
|
||||||
? "detected-from-miner-tx-extra"
|
? "detected-from-miner-tx-extra"
|
||||||
: null;
|
: 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);
|
const txResponse = await rpc.getTransactions(txHashes);
|
||||||
if (txResponse.status !== "OK") {
|
if (txResponse.status !== "OK") {
|
||||||
throw new Error(`gettransactions for block ${height} returned ${txResponse.status}`);
|
throw new Error(`gettransactions for block ${height} returned ${txResponse.status}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user