fix: avoid setting every blNum to 0 if genesis is there (#39)

This commit is contained in:
Carlo Sala
2025-04-09 13:05:27 +02:00
committed by GitHub
parent 90b1f5a19b
commit 505fa10496
+1 -1
View File
@@ -78,7 +78,7 @@ export const [blockInfo$, recordedBlocks$] = partitionByKey(
const blockNumbers: Record<string, number> = {}
evt.finalizedBlockHashes.forEach((hash, i) => {
const parent = blockNumbers[evt.finalizedBlockHashes[i - 1]]
blockNumbers[hash] = parent ? parent + 1 : evt.number
blockNumbers[hash] = parent != null ? parent + 1 : evt.number
})
return {
value: evt.finalizedBlockHashes.map((hash, i) => ({