Commit d9c2b95
committed
Merge #1976: Disallow unconfirmed coinbase
c84035e test(chain): Add scenario: coinbase tx must not become unconfirmed (志宇)
e8da007 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 c84035e
Tree-SHA512: 3aaff032ce390a7a8845c8704727daccab1afa2b0437f6706802f6ec37f7ffd79729407f1cba91b7e5045974a3a627c78a150242e2aaacb04a03b8f47528046bFile tree
2 files changed
+27
-1
lines changed- crates/chain
- src
- tests
2 files changed
+27
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
233 | 237 | | |
234 | 238 | | |
235 | 239 | | |
| |||
238 | 242 | | |
239 | 243 | | |
240 | 244 | | |
241 | | - | |
| 245 | + | |
242 | 246 | | |
243 | 247 | | |
244 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
943 | 943 | | |
944 | 944 | | |
945 | 945 | | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
946 | 968 | | |
947 | 969 | | |
948 | 970 | | |
| |||
0 commit comments