From c6d845d4aca647efbb938ec678a1b9dd7088790c Mon Sep 17 00:00:00 2001 From: Natacha De la Rosa Date: Fri, 18 Aug 2023 18:28:21 +0200 Subject: [PATCH] feat(blocks): allow index finalized blocks --- substrate/substrate-ingest/src/ingest.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/substrate/substrate-ingest/src/ingest.ts b/substrate/substrate-ingest/src/ingest.ts index 2d1d7a4ec..601732465 100644 --- a/substrate/substrate-ingest/src/ingest.ts +++ b/substrate/substrate-ingest/src/ingest.ts @@ -288,12 +288,12 @@ export class Ingest { } private async getChainHeight(): Promise { - let hash = await this.client.call('chain_getFinalizedHead') + let hash = await this.client.call('chain_getHead') return this.client.call('chain_getHeader', [hash]) .then(header => { let height = parseInt(header.number) assert(Number.isSafeInteger(height)) - return height + if (height%10 === 0) return height }).catch(withErrorContext({ blockHash: hash }))