Instance Property
bestEntry
The best (tip) block tree entry — the block with the most cumulative proof-of-work that the kernel currently considers the chain’s head.
var bestEntry: BlockTreeEntry { get }
Mentioned In
Discussion
A view type whose lifetime is tied to this manager; keep the manager alive while you hold the returned BlockTreeEntry, or promote to an owned BlockTreeEntrySnapshot for safe storage. Reads bestEntry repeatedly during a sync run to track progress.
Traps with preconditionFailure if the chainstate manager has no best header — currently observable only after a (true, true) wipe before genesis is re-loaded. See upstream-issues/bitcoin/chainstate-get-best-entry-null-after-wipe.md in the swift-bitcoinkernel repo. The trap converts what would otherwise be a SIGSEGV inside btck_block_tree_entry_get_height into a diagnosable Swift fatal error.