Skip to content

Commit 8537ecd

Browse files
committed
Revert "Enable policy enforcing GetMedianTimePast as the end point of lock-time constraints"
This reverts commit dea8d21.
1 parent 02a95be commit 8537ecd

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/policy/policy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ static const unsigned int STANDARD_SCRIPT_VERIFY_FLAGS = MANDATORY_SCRIPT_VERIFY
4444
static const unsigned int STANDARD_NOT_MANDATORY_VERIFY_FLAGS = STANDARD_SCRIPT_VERIFY_FLAGS & ~MANDATORY_SCRIPT_VERIFY_FLAGS;
4545

4646
/** Used as the flags parameter to CheckFinalTx() in non-consensus code */
47-
static const unsigned int STANDARD_LOCKTIME_VERIFY_FLAGS = LOCKTIME_MEDIAN_TIME_PAST;
47+
static const unsigned int STANDARD_LOCKTIME_VERIFY_FLAGS = 0;
4848

4949
bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType);
5050
/**

src/test/miner_tests.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
#include "chainparams.h"
66
#include "coins.h"
7-
#include "consensus/consensus.h"
87
#include "consensus/validation.h"
98
#include "main.h"
109
#include "miner.h"
@@ -230,7 +229,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
230229
tx.nLockTime = chainActive.Tip()->nHeight+1;
231230
hash = tx.GetHash();
232231
mempool.addUnchecked(hash, CTxMemPoolEntry(tx, 11, GetTime(), 111.0, 11));
233-
BOOST_CHECK(!CheckFinalTx(tx, LOCKTIME_MEDIAN_TIME_PAST));
232+
BOOST_CHECK(!CheckFinalTx(tx));
234233

235234
// time locked
236235
tx2.vin.resize(1);
@@ -244,7 +243,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
244243
tx2.nLockTime = chainActive.Tip()->GetMedianTimePast()+1;
245244
hash = tx2.GetHash();
246245
mempool.addUnchecked(hash, CTxMemPoolEntry(tx2, 11, GetTime(), 111.0, 11));
247-
BOOST_CHECK(!CheckFinalTx(tx2, LOCKTIME_MEDIAN_TIME_PAST));
246+
BOOST_CHECK(!CheckFinalTx(tx2));
248247

249248
BOOST_CHECK(pblocktemplate = CreateNewBlock(scriptPubKey));
250249

@@ -262,7 +261,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
262261
//BOOST_CHECK(CheckFinalTx(tx2));
263262

264263
BOOST_CHECK(pblocktemplate = CreateNewBlock(scriptPubKey));
265-
BOOST_CHECK_EQUAL(pblocktemplate->block.vtx.size(), 2);
264+
BOOST_CHECK_EQUAL(pblocktemplate->block.vtx.size(), 3);
266265
delete pblocktemplate;
267266

268267
chainActive.Tip()->nHeight--;

0 commit comments

Comments
 (0)