Initializer
init(hash:height:timestamp:)
Creates a BlockTip.
init(hash: Data, height: Int, timestamp: Date? = nil)
Parameters
-
hash
-
Exactly 32 bytes in internal (kernel) byte order. Passing display-order hex bytes here will make the tip compare unequal to every kernel-produced tip.
-
height
-
The block’s height above genesis (≥ 0).
-
timestamp
-
The block’s header timestamp, or nil when unknown.
Discussion
Precondition
hash.count == 32. Wrong-length hashes crash rather than silently truncate — this is a programmer error, not a runtime condition callers can recover from.
BlockTip(hash: Data(repeating: 0, count: 32), height: 0) // genesis placeholder