Instance Method
blockHash(atHeight:)
The hash of the block at the given height, in internal byte order.
func blockHash(atHeight height: Int) async throws -> Data
Parameters
-
height
-
Height above genesis (0 = genesis).
Return Value
32 bytes of hash data in internal (kernel) byte order.
Discussion
Throws
BlockSourceError.notFound if the source has no block at that height, or a transport-level BlockSourceError otherwise.
Warning
Returns whichever block the source currently thinks is at that height. During a reorg, the answer can change. The sync engine uses this method exactly once per run — at the fork-point check on resume — and walks by hash everywhere else. Don’t use it for chain identity in application code either.