]> Untitled Git - bdk/commit
Merge bitcoindevkit/bdk#2174: fix(chain): prevent `merge_chains` from replacing the...
authormerge-script <hello@evanlinjin.me>
Thu, 23 Apr 2026 16:46:35 +0000 (16:46 +0000)
committermerge-script <hello@evanlinjin.me>
Thu, 23 Apr 2026 16:46:35 +0000 (16:46 +0000)
commitf47cb0b674f97b77328f1de50ca5863901b84f19
tree543d0e0de75394b2e440db36f2639b4e69bca9ee
parentf07423a7bab932035113bd14c4ad82017dcd4096
parentbe8e156115e21750158d44394341f1d41dfbf90f
Merge bitcoindevkit/bdk#2174: fix(chain): prevent `merge_chains` from replacing the genesis block

be8e156115e21750158d44394341f1d41dfbf90f fix(chain): prevent `merge_chains` from replacing the genesis block (Elias Rohrer)

Pull request description:

  ### Description

  Other code paths (`disconnect_from`, `CheckPoint::insert`) already protect height 0 from modification, but `merge_chains` allowed an update chain with a different genesis hash to silently replace the wallet's existing genesis block. Return `CannotConnectError` when the update attempts to change the block hash at height 0.

Co-Authored-By: HAL 9000
  ### Checklists

  #### All Submissions:

  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)

  #### Bugfixes:

  * [ ] This pull request breaks the existing API
  * [x] I've added tests to reproduce the issue which are now passing
  * [ ] I'm linking the issue being fixed by this PR

ACKs for top commit:
  ValuedMammal:
    ACK be8e156115e21750158d44394341f1d41dfbf90f
  evanlinjin:
    ACK be8e156115e21750158d44394341f1d41dfbf90f

Tree-SHA512: 743c95f281faf39f7f825693e684ad96a70b2994a6186721a68eacd0c3d4488092883e6dfe3b349e5241fc9a85a02dad222da7e932a50be5324df69d73cbb4a6