diff options
author | MarcoFalke <falke.marco@gmail.com> | 2022-03-14 16:32:17 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2022-03-14 16:32:23 +0100 |
commit | 28bdaa3f7697eef6c3d97e952228ce92e5d18aae (patch) | |
tree | 475eca8b12f55c009f0562e3a7a9549d9a23131d /src/i2p.cpp | |
parent | 25d045a9ecc24a2752685d176c28f8f75bb100f6 (diff) | |
parent | fa8d4d9128c35de0fe715f2e2b99269d23c09cc1 (diff) |
Merge bitcoin/bitcoin#24080: policy: Remove unused locktime flags
fa8d4d9128c35de0fe715f2e2b99269d23c09cc1 scripted-diff: Clarify CheckFinalTxAtTip name (MarcoFalke)
fa4e30b0f36f2e7a09db7d30dca9008ed9dbcb35 policy: Remove unused locktime flags (MarcoFalke)
Pull request description:
The locktime flags have many issues:
* They are passed in by a default argument, which is fragile. It has already lead to bugs like the one fixed in commit e30b6ea194fee3bb95a45e7b732a99566b88f1f5.
* They are negative (signed), which doesn't make sense for flags (unsigned in general). According to the review comments when the code was added: "The max on the flags is a fairly weird operation." (https://github.com/bitcoin/bitcoin/pull/6566#issuecomment-150310861)
* No call site relies on the default argument and they all pass in a single compile-time constant, rendering most of the code dead and untested.
* The dead code calls `GetAdjustedTime` (network adjusted time), which has its own issues. See https://github.com/bitcoin/bitcoin/issues/4521
Fix all issues by removing them
ACKs for top commit:
ajtowns:
ACK fa8d4d9128c35de0fe715f2e2b99269d23c09cc1
theStack:
Code-review ACK fa8d4d9128c35de0fe715f2e2b99269d23c09cc1
glozow:
ACK fa8d4d9128c35de0fe715f2e2b99269d23c09cc1, agree the default arg `flags` is a massive footgun and just setting max flags is weird. Adding `AtTip` to the names makes sense to me, since they're both testing for *next* block and only ever used for {,re}addition to mempool.
Tree-SHA512: 79f4a52f34909eb598d88bbae7afe8abe5f85f45c128483d16aa83dacd0e5579e561b725d01b1e9a931d1821012a51ad2bc6fb2867f8d09ee541f9d234d696f8
Diffstat (limited to 'src/i2p.cpp')
0 files changed, 0 insertions, 0 deletions