|
|
|
@ -4,6 +4,7 @@
@@ -4,6 +4,7 @@
|
|
|
|
|
|
|
|
|
|
#include "chainparams.h" |
|
|
|
|
#include "coins.h" |
|
|
|
|
#include "consensus/consensus.h" |
|
|
|
|
#include "consensus/validation.h" |
|
|
|
|
#include "main.h" |
|
|
|
|
#include "miner.h" |
|
|
|
@ -229,7 +230,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
@@ -229,7 +230,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); |
|
|
|
@ -243,7 +244,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
@@ -243,7 +244,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)); |
|
|
|
|
|
|
|
|
@ -261,7 +262,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
@@ -261,7 +262,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--; |
|
|
|
|