Changeset View
Changeset View
Standalone View
Standalone View
src/test/miner_tests.cpp
Show First 20 Lines • Show All 669 Lines • ▼ Show 20 Lines | BOOST_AUTO_TEST_CASE(CreateNewBlock_validity) { | ||||
BOOST_CHECK(!TestSequenceLocks(CTransaction(tx), flags)); | BOOST_CHECK(!TestSequenceLocks(CTransaction(tx), flags)); | ||||
tx.vin[0].nSequence = CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG; | tx.vin[0].nSequence = CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG; | ||||
// Sequence locks pass. | // Sequence locks pass. | ||||
BOOST_CHECK(TestSequenceLocks(CTransaction(tx), flags)); | BOOST_CHECK(TestSequenceLocks(CTransaction(tx), flags)); | ||||
tx.vin[0].nSequence = CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG | 1; | tx.vin[0].nSequence = CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG | 1; | ||||
// Sequence locks fail. | // Sequence locks fail. | ||||
BOOST_CHECK(!TestSequenceLocks(CTransaction(tx), flags)); | BOOST_CHECK(!TestSequenceLocks(CTransaction(tx), flags)); | ||||
BOOST_CHECK(pblocktemplate = | pblocktemplate = BlockAssembler(config).CreateNewBlock(scriptPubKey); | ||||
BlockAssembler(config).CreateNewBlock(scriptPubKey)); | BOOST_CHECK(pblocktemplate); | ||||
// None of the of the absolute height/time locked tx should have made it | // None of the of the absolute height/time locked tx should have made it | ||||
// into the template because we still check IsFinalTx in CreateNewBlock, but | // into the template because we still check IsFinalTx in CreateNewBlock, but | ||||
// relative locked txs will if inconsistently added to mempool. For now | // relative locked txs will if inconsistently added to mempool. For now | ||||
// these will still generate a valid template until BIP68 soft fork. | // these will still generate a valid template until BIP68 soft fork. | ||||
BOOST_CHECK_EQUAL(pblocktemplate->block.vtx.size(), 3UL); | BOOST_CHECK_EQUAL(pblocktemplate->block.vtx.size(), 3UL); | ||||
// However if we advance height by 1 and time by 512, all of them should be | // However if we advance height by 1 and time by 512, all of them should be | ||||
// mined. | // mined. | ||||
▲ Show 20 Lines • Show All 74 Lines • Show Last 20 Lines |