diff options
author | Mark Friedenbach <mark@friedenbach.org> | 2015-06-03 15:01:47 -0700 |
---|---|---|
committer | BtcDrak <btcdrak@gmail.com> | 2015-10-23 21:33:51 +0100 |
commit | f720c5fc9f34899ec82e23d12f369c9bf37003e7 (patch) | |
tree | eca6e8dad156b3bd08c03807017bec0d21a375d4 | |
parent | a1d3c6fb9de8a3fc3e36bc3753a6831cb1dfdbcb (diff) |
Enable policy enforcing GetMedianTimePast as the end point of lock-time constraints
Transactions are not allowed in the memory pool or selected for inclusion in a block until their lock times exceed chainActive.Tip()->GetMedianTimePast(). However blocks including transactions which are only mature under the old rules are still accepted; this is *not* the soft-fork required to actually rely on the new constraint in production.
-rw-r--r-- | src/consensus/consensus.h | 2 | ||||
-rw-r--r-- | src/test/miner_tests.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/consensus/consensus.h b/src/consensus/consensus.h index 6195d6a79f..fc2d01f917 100644 --- a/src/consensus/consensus.h +++ b/src/consensus/consensus.h @@ -20,6 +20,6 @@ enum { }; /** Used as the flags parameter to CheckFinalTx() in non-consensus code */ -static const unsigned int STANDARD_LOCKTIME_VERIFY_FLAGS = 0; +static const unsigned int STANDARD_LOCKTIME_VERIFY_FLAGS = LOCKTIME_MEDIAN_TIME_PAST; #endif // BITCOIN_CONSENSUS_CONSENSUS_H diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp index 9e4fd8513e..e419d61e76 100644 --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -223,7 +223,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)); + BOOST_CHECK(!CheckFinalTx(tx, LOCKTIME_MEDIAN_TIME_PAST)); // time locked tx2.vin.resize(1); @@ -237,7 +237,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)); + BOOST_CHECK(!CheckFinalTx(tx2, LOCKTIME_MEDIAN_TIME_PAST)); BOOST_CHECK(pblocktemplate = CreateNewBlock(scriptPubKey)); @@ -255,7 +255,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity) //BOOST_CHECK(CheckFinalTx(tx2)); BOOST_CHECK(pblocktemplate = CreateNewBlock(scriptPubKey)); - BOOST_CHECK_EQUAL(pblocktemplate->block.vtx.size(), 3); + BOOST_CHECK_EQUAL(pblocktemplate->block.vtx.size(), 2); delete pblocktemplate; chainActive.Tip()->nHeight--; |