Instance Method
processBlock(_:)
Processes a block for validation and potential inclusion in the active chain — the workhorse of every sync run.
func processBlock(_ block: Block) -> (success: Bool, isNew: Bool)
Parameters
-
block
-
The block to process.
Return Value
A tuple of (success, isNew). success is true if the kernel accepted the block OR already had it; inspect the post-call bestEntry to see whether this block became the new tip. isNew is true if the kernel had not previously seen this block.
Discussion
Runs CheckBlock + ContextualCheckBlock + ConnectBlock from Bitcoin Core’s validation.cpp. On success, the chainstate advances; on a chain-reorg scenario the kernel may internally switch to a new best chain without any extra caller action. This call can take seconds on mainnet-sized blocks and is interruptible via interrupt().