From 8537ecdfc40181249ec37556015a99cfae4b21fd Mon Sep 17 00:00:00 2001 From: Gregory Maxwell Date: Sun, 1 Nov 2015 20:05:16 +0000 Subject: [PATCH] Revert "Enable policy enforcing GetMedianTimePast as the end point of lock-time constraints" This reverts commit dea8d21fc63e9f442299c97010e4740558f4f037. --- src/policy/policy.h | 2 +- src/test/miner_tests.cpp | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/policy/policy.h b/src/policy/policy.h index f269e8d47..fdc54a70a 100644 --- a/src/policy/policy.h +++ b/src/policy/policy.h @@ -44,7 +44,7 @@ static const unsigned int STANDARD_SCRIPT_VERIFY_FLAGS = MANDATORY_SCRIPT_VERIFY 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 = LOCKTIME_MEDIAN_TIME_PAST; +static const unsigned int STANDARD_LOCKTIME_VERIFY_FLAGS = 0; bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType); /** diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp index 827525783..91a3a5738 100644 --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -4,7 +4,6 @@ #include "chainparams.h" #include "coins.h" -#include "consensus/consensus.h" #include "consensus/validation.h" #include "main.h" #include "miner.h" @@ -230,7 +229,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity) tx.nLockTime = chainActive.Tip()->nHeight+1; hash = tx.GetHash(); mempool.addUnchecked(hash, CTxMemPoolEntry(tx, 11, GetTime(), 111.0, 11)); - BOOST_CHECK(!CheckFinalTx(tx, LOCKTIME_MEDIAN_TIME_PAST)); + BOOST_CHECK(!CheckFinalTx(tx)); // time locked tx2.vin.resize(1); @@ -244,7 +243,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity) tx2.nLockTime = chainActive.Tip()->GetMedianTimePast()+1; hash = tx2.GetHash(); mempool.addUnchecked(hash, CTxMemPoolEntry(tx2, 11, GetTime(), 111.0, 11)); - BOOST_CHECK(!CheckFinalTx(tx2, LOCKTIME_MEDIAN_TIME_PAST)); + BOOST_CHECK(!CheckFinalTx(tx2)); BOOST_CHECK(pblocktemplate = CreateNewBlock(scriptPubKey)); @@ -262,7 +261,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity) //BOOST_CHECK(CheckFinalTx(tx2)); BOOST_CHECK(pblocktemplate = CreateNewBlock(scriptPubKey)); - BOOST_CHECK_EQUAL(pblocktemplate->block.vtx.size(), 2); + BOOST_CHECK_EQUAL(pblocktemplate->block.vtx.size(), 3); delete pblocktemplate; chainActive.Tip()->nHeight--;