HomePhabricator

Remove LOCKTIME_MEDIAN_TIME_PAST constant

Description

Remove LOCKTIME_MEDIAN_TIME_PAST constant

Summary:

miner: Remove uncompiled MTP code

This removes uncompiled code in miner.cpp.

Can be checked by inserting static_assert(STANDARD_LOCKTIME_VERIFY_FLAGS & LOCKTIME_MEDIAN_TIME_PAST) and compiling or by reading the source code.

Even if the code was compiled, it would be unsafe to execute, since it is not allowed to include transactions that are locked until some time after the current MTP.

Also, rename the member to cause explicit merge conflicts in case there is a patch out there referencing the variable.

Remove LOCKTIME_MEDIAN_TIME_PAST constant

The constant is exposed in policy code, which doesn't make sense:

  • Wallet and mempool need to assume the flag to be always active to function properly.
  • Setting (or unsetting) the flag has no effect on policy code.

The constant is only used in ContextualCheckBlock (consensus code) to set a flag and then read the flag again. I think this can be better achieved by using a bool. If there is a need to use a flag in the future, it will be trivial to do so then.

This is a backport of core#23637 and core#24565

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
MarcoFalke <falke.marco@gmail.com>Authored on Mar 14 2022, 17:20
PiRKCommitted on Jan 3 2024, 10:08
PiRKPushed on Jan 3 2024, 10:08
Reviewer
Restricted Project
Differential Revision
D15039: Remove LOCKTIME_MEDIAN_TIME_PAST constant
Parents
rABCba586c6501ff: [doc] Complete instructions to run the user systemd service on boot
Branches
Unknown
Tags
Unknown