diff options
author | Mark Friedenbach <mark@friedenbach.org> | 2015-06-03 12:55:45 -0700 |
---|---|---|
committer | Mark Friedenbach <mark@friedenbach.org> | 2015-10-23 09:02:24 -0700 |
commit | 9d55050773d57c0e12005e524f2e54d9e622c6e2 (patch) | |
tree | 5e07889ff64f153d39b0a4b06d5e2ac29621153f /src/policy | |
parent | 46f74379b86be982b121bcb8c3cfe07fa80bffd0 (diff) |
Add rules--presently disabled--for using GetMedianTimePast as endpoint for lock-time calculations
The lock-time code currently uses CBlock::nTime as the cutoff point for time based locked transactions. This has the unfortunate outcome of creating a perverse incentive for miners to lie about the time of a block in order to collect more fees by including transactions that by wall clock determination have not yet matured. By using CBlockIndex::GetMedianTimePast from the prior block instead, the self-interested miner no longer gains from generating blocks with fraudulent timestamps. Users can compensate for this change by simply adding an hour (3600 seconds) to their time-based lock times.
If enforced, this would be a soft-fork change. This commit only adds the functionality on an unexecuted code path, without changing the behaviour of Bitcoin Core.
Diffstat (limited to 'src/policy')
-rw-r--r-- | src/policy/policy.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/policy/policy.h b/src/policy/policy.h index 0ea0d435ad..cfe6a40526 100644 --- a/src/policy/policy.h +++ b/src/policy/policy.h @@ -43,6 +43,9 @@ static const unsigned int STANDARD_SCRIPT_VERIFY_FLAGS = MANDATORY_SCRIPT_VERIFY /** For convenience, standard but not mandatory verify flags. */ static const unsigned int STANDARD_NOT_MANDATORY_VERIFY_FLAGS = STANDARD_SCRIPT_VERIFY_FLAGS & ~MANDATORY_SCRIPT_VERIFY_FLAGS; +/** Used as the flags parameter to CheckFinalTx() in non-consensus code */ +static const unsigned int STANDARD_LOCKTIME_VERIFY_FLAGS = 0; + bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType); /** * Check for standard transaction types |