Sync chain to the server's tip, validating every header locally.
Reorg discipline: only a ReorgLinkError (the batch's first header failing
to link at tipHeight+1) triggers a one-step rewind; consensus failures
(PoW, bits, MTP, checkpoints) abort the sync unchanged. Rewinds and the
competing branch are staged IN MEMORY and adopted only if the resulting
chain carries strictly more cumulative work than the pre-rewind chain
(most-work rule, not tallest); otherwise the original state is restored
and the sync fails. The persistence file is rewritten once, on adoption.
Sync
chainto the server's tip, validating every header locally.Reorg discipline: only a ReorgLinkError (the batch's first header failing to link at tipHeight+1) triggers a one-step rewind; consensus failures (PoW, bits, MTP, checkpoints) abort the sync unchanged. Rewinds and the competing branch are staged IN MEMORY and adopted only if the resulting chain carries strictly more cumulative work than the pre-rewind chain (most-work rule, not tallest); otherwise the original state is restored and the sync fails. The persistence file is rewritten once, on adoption.