ordspv
    Preparing search index...
    Index
    baseHeight: number
    params: ChainParams
    • Validate and append count = raw.length/80 headers extending the tip. All headers validate before anything is committed or persisted.

      A prev-hash mismatch on the FIRST header (i.e. at tipHeight+1) throws the typed ReorgLinkError: it is the only failure that is evidence of a chain reorganization rather than a bad batch. Every other failure (PoW, bits, median-time-past, checkpoint, deep linkage break) is a plain Error and must never trigger a rewind.

      Parameters

      • raw: Uint8Array
      • opts: { persist?: boolean } = {}

      Returns number

    • Drop headers above height (reorg handling). With persist: false the rewind stays in memory (the file is rewritten once by the next persisting append or an explicit flush()).

      Parameters

      • height: number
      • opts: { persist?: boolean } = {}

      Returns void