]> Untitled Git - bdk/commit
fix(chain)!: report `prev_blockhash` mismatches from `insert_block`
author志宇 <hello@evanlinjin.me>
Thu, 15 Oct 2026 09:54:57 +0000 (09:54 +0000)
committer志宇 <hello@evanlinjin.me>
Sun, 18 Oct 2026 07:17:38 +0000 (18:17 +1100)
commitae236638b881894a7f19530ef37f031f3bcfb31a
tree78ecfd73aa54118caa84b9fd9a7b3ce05b7e89b7
parent4629f55138da1ee946bd49f7332ccbf0cd5af646
fix(chain)!: report `prev_blockhash` mismatches from `insert_block`

`insert_block` mapped every `apply_changeset` error to an
`AlterCheckPointError` about removing genesis. The only reachable error
there is a `prev_blockhash` mismatch, so callers inserting an unlinked
`Header` were told genesis could not be removed.

`insert_block` now returns `InsertBlockError`, which reports either the
existing conflicting block or the `prev_blockhash` mismatch. With no
users left, `AlterCheckPointError` is removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
crates/chain/src/local_chain.rs
crates/chain/tests/test_local_chain.rs