```
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.