]> Untitled Git - bdk/commit
Merge bitcoindevkit/bdk#1976: Disallow unconfirmed coinbase
authormerge-script <hello@evanlinjin.me>
Thu, 10 Jul 2025 03:04:24 +0000 (03:04 +0000)
committermerge-script <hello@evanlinjin.me>
Thu, 10 Jul 2025 03:04:24 +0000 (03:04 +0000)
commitd9c2b95512608f694a177b823b163f67c3326e15
tree48e94665b64502cae127268452d503e61198b957
parenta7c1bcc37d67965e331faf09510937109b167df4
parentc84035e4d804943da7b3308411a1402b1ff6e2ad
Merge bitcoindevkit/bdk#1976: Disallow unconfirmed coinbase

c84035e4d804943da7b3308411a1402b1ff6e2ad test(chain): Add scenario: coinbase tx must not become unconfirmed (志宇)
e8da007011c3c7e247c26a1c9984319229bb0afa fix(chain): Unconfirmed coinbase txs should never be canonical (志宇)

Pull request description:

  ### Description

  The logic in `CanonicalIter` includes transactions anchored to blocks outside the best chain, since they may still appear in the mempool.

  However, coinbase transactions can never be unconfirmed—a case the previous logic failed to exclude.

  ### Notes to the reviewers

  Sorry for my previous oversight on this.

  ### Changelog notice

  ```md
  Fixed:
  - During canonicalization, exclude coinbase transactions when considering txs that are anchored in stale blocks.
  ```

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo +nightly fmt` and `cargo clippy` before committing

  #### 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:
  evanlinjin:
    self-ACK c84035e4d804943da7b3308411a1402b1ff6e2ad

Tree-SHA512: 3aaff032ce390a7a8845c8704727daccab1afa2b0437f6706802f6ec37f7ffd79729407f1cba91b7e5045974a3a627c78a150242e2aaacb04a03b8f47528046b