Instance Method
processBlockHeader(_:state:)
Processes a block header for validation — runs Bitcoin Core’s AcceptBlockHeader checks without requiring the full block body.
@discardableResult func processBlockHeader(_ header: BlockHeader, state: BlockValidationState) -> Bool
Parameters
-
header
-
The block header to process.
-
state
-
Populated on return with the validation result.
Return Value
true if header processing completed successfully.
Discussion
Useful for header-first IBD patterns where headers arrive before blocks. A true return means the header passed initial checks (proof-of-work, timestamp bounds, version-bit activation, linkage to a known parent) — not that the block extends the best chain. Inspect state for a typed rejection reason on failure.