Structure
BlockTip
A snapshot identifying a specific block on a chain — paired 32-byte hash, height, and an optional header timestamp. The canonical “where am I?” value used by every BlockSource conformer and throughout the BlockchainSync engine.
struct BlockTip
Overview
Mirrors Bitcoin Core’s interfaces::BlockTip struct — the same concept surfaced through a Swift value type with synthesized Equatable / Hashable conformances.
let entry = manager.bestEntry
let tip = BlockTip(
hash: entry.blockHash.data,
height: Int(entry.height),
timestamp: Date(timeIntervalSince1970: TimeInterval(entry.blockHeader.timestamp))
)
Important
The 32-byte hash is the canonical block identifier. height alone is not a safe identifier across reorgs — during a reorg, two different blocks can share the same height. Prefer hash-addressed APIs (blockHeader(for:) and block(for:)) for anything that must survive a reorg.
Topics
Initializers
Instance Properties