Skip to content

Commit d1c3762

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

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
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 = 0;
47+
static const unsigned int STANDARD_LOCKTIME_VERIFY_FLAGS = LOCKTIME_MEDIAN_TIME_PAST;
4848

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

src/test/miner_tests.cpp

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

55
#include "chainparams.h"
66
#include "coins.h"
7+
#include "consensus/consensus.h"
78
#include "consensus/validation.h"
89
#include "main.h"
910
#include "miner.h"
@@ -229,7 +230,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
229230
tx.nLockTime = chainActive.Tip()->nHeight+1;
230231
hash = tx.GetHash();
231232
mempool.addUnchecked(hash, CTxMemPoolEntry(tx, 11, GetTime(), 111.0, 11));
232-
BOOST_CHECK(!CheckFinalTx(tx));
233+
BOOST_CHECK(!CheckFinalTx(tx, LOCKTIME_MEDIAN_TIME_PAST));
233234

234235
// time locked
235236
tx2.vin.resize(1);
@@ -243,7 +244,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
243244
tx2.nLockTime = chainActive.Tip()->GetMedianTimePast()+1;
244245
hash = tx2.GetHash();
245246
mempool.addUnchecked(hash, CTxMemPoolEntry(tx2, 11, GetTime(), 111.0, 11));
246-
BOOST_CHECK(!CheckFinalTx(tx2));
247+
BOOST_CHECK(!CheckFinalTx(tx2, LOCKTIME_MEDIAN_TIME_PAST));
247248

248249
BOOST_CHECK(pblocktemplate = CreateNewBlock(scriptPubKey));
249250

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

263264
BOOST_CHECK(pblocktemplate = CreateNewBlock(scriptPubKey));
264-
BOOST_CHECK_EQUAL(pblocktemplate->block.vtx.size(), 3);
265+
BOOST_CHECK_EQUAL(pblocktemplate->block.vtx.size(), 2);
265266
delete pblocktemplate;
266267

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

0 commit comments

Comments
 (0)