HomePhabricator

policy: Remove unused locktime flags

Description

policy: Remove unused locktime flags

Summary:

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 e30b6ea.
    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." (

BIP-113: Mempool-only median time-past as endpoint for lock-time calculationsĀ #6566 (comment))
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

    AddTimeData will never update nTimeOffset past 199 samplesĀ #4521

Fix all issues by removing them

Backport of core#24080.

Depends on D12949 and D12950.

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, sdulfari

Reviewed By: #bitcoin_abc, sdulfari

Subscribers: sdulfari

Differential Revision: https://reviews.bitcoinabc.org/D12951

Details

Provenance
MarcoFalke <falke.marco@gmail.com>Authored on Jan 11 2022, 16:02
FabienCommitted on Jan 5 2023, 21:16
FabienPushed on Jan 5 2023, 21:16
Reviewer
Restricted Project
Differential Revision
D12951: policy: Remove unused locktime flags
Parents
rABC9ba8816a1f2f: Remove unused MTP from ContextualCheckTransaction
Branches
Unknown
Tags
Unknown