@@ -122,7 +122,7 @@ void MinerTestingSetup::TestPackageSelection(const CScript& scriptPubKey, const
122122 BOOST_CHECK (tx_mempool.size () == 0 );
123123
124124 // Block template should only have a coinbase when there's nothing in the mempool
125- std::unique_ptr<BlockTemplate> block_template = mining->createNewBlock (options);
125+ std::unique_ptr<BlockTemplate> block_template = mining->createNewBlock (options, /* cooldown= */ false );
126126 BOOST_REQUIRE (block_template);
127127 CBlock block{block_template->getBlock ()};
128128 BOOST_REQUIRE_EQUAL (block.vtx .size (), 1U );
@@ -166,7 +166,7 @@ void MinerTestingSetup::TestPackageSelection(const CScript& scriptPubKey, const
166166 const auto high_fee_tx{entry.Fee (50000 ).Time (Now<NodeSeconds>()).SpendsCoinbase (false ).FromTx (tx)};
167167 TryAddToMempool (tx_mempool, high_fee_tx);
168168
169- block_template = mining->createNewBlock (options);
169+ block_template = mining->createNewBlock (options, /* cooldown= */ false );
170170 BOOST_REQUIRE (block_template);
171171 block = block_template->getBlock ();
172172 BOOST_REQUIRE_EQUAL (block.vtx .size (), 4U );
@@ -253,7 +253,7 @@ void MinerTestingSetup::TestPackageSelection(const CScript& scriptPubKey, const
253253 tx.vout [0 ].nValue = 5000000000LL - 100000000 - feeToUse;
254254 Txid hashLowFeeTx2 = tx.GetHash ();
255255 TryAddToMempool (tx_mempool, entry.Fee (feeToUse).SpendsCoinbase (false ).FromTx (tx));
256- block_template = mining->createNewBlock (options);
256+ block_template = mining->createNewBlock (options, /* cooldown= */ false );
257257 BOOST_REQUIRE (block_template);
258258 block = block_template->getBlock ();
259259
@@ -268,7 +268,7 @@ void MinerTestingSetup::TestPackageSelection(const CScript& scriptPubKey, const
268268 tx.vin [0 ].prevout .n = 1 ;
269269 tx.vout [0 ].nValue = 100000000 - 10000 ; // 10k satoshi fee
270270 TryAddToMempool (tx_mempool, entry.Fee (10000 ).FromTx (tx));
271- block_template = mining->createNewBlock (options);
271+ block_template = mining->createNewBlock (options, /* cooldown= */ false );
272272 BOOST_REQUIRE (block_template);
273273 block = block_template->getBlock ();
274274 BOOST_REQUIRE_EQUAL (block.vtx .size (), 9U );
@@ -342,7 +342,7 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::
342342 LOCK (tx_mempool.cs );
343343
344344 // Just to make sure we can still make simple blocks
345- auto block_template{mining->createNewBlock (options)};
345+ auto block_template{mining->createNewBlock (options, /* cooldown= */ false )};
346346 BOOST_REQUIRE (block_template);
347347 CBlock block{block_template->getBlock ()};
348348
@@ -358,7 +358,7 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::
358358 }
359359 assert (tx_mempool.mapTx .size () == 51 );
360360 assert (legacy_sigops == 20001 );
361- BOOST_CHECK_EXCEPTION (mining->createNewBlock (options), std::runtime_error, HasReason (" bad-blk-sigops" ));
361+ BOOST_CHECK_EXCEPTION (mining->createNewBlock (options, /* cooldown= */ false ), std::runtime_error, HasReason (" bad-blk-sigops" ));
362362 }
363363
364364 {
@@ -369,7 +369,7 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::
369369 assert (tx_mempool.mapTx .empty ());
370370
371371 // Just to make sure we can still make simple blocks
372- auto block_template{mining->createNewBlock (options)};
372+ auto block_template{mining->createNewBlock (options, /* cooldown= */ false )};
373373 BOOST_REQUIRE (block_template);
374374 CBlock block{block_template->getBlock ()};
375375
@@ -384,7 +384,7 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::
384384 assert (tx_mempool.mapTx .size () == 51 );
385385 assert (legacy_sigops == 20001 );
386386
387- BOOST_REQUIRE (mining->createNewBlock (options));
387+ BOOST_REQUIRE (mining->createNewBlock (options, /* cooldown= */ false ));
388388 }
389389
390390 {
@@ -414,7 +414,7 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::
414414 BOOST_CHECK (tx_mempool.GetIter (hash).has_value ());
415415 tx.vin [0 ].prevout .hash = hash;
416416 }
417- BOOST_REQUIRE (mining->createNewBlock (options));
417+ BOOST_REQUIRE (mining->createNewBlock (options, /* cooldown= */ false ));
418418 }
419419
420420 {
@@ -424,7 +424,7 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::
424424 // orphan in tx_mempool, template creation fails
425425 hash = tx.GetHash ();
426426 TryAddToMempool (tx_mempool, entry.Fee (LOWFEE).Time (Now<NodeSeconds>()).FromTx (tx));
427- BOOST_CHECK_EXCEPTION (mining->createNewBlock (options), std::runtime_error, HasReason (" bad-txns-inputs-missingorspent" ));
427+ BOOST_CHECK_EXCEPTION (mining->createNewBlock (options, /* cooldown= */ false ), std::runtime_error, HasReason (" bad-txns-inputs-missingorspent" ));
428428 }
429429
430430 {
@@ -445,7 +445,7 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::
445445 tx.vout [0 ].nValue = tx.vout [0 ].nValue + BLOCKSUBSIDY - HIGHERFEE; // First txn output + fresh coinbase - new txn fee
446446 hash = tx.GetHash ();
447447 TryAddToMempool (tx_mempool, entry.Fee (HIGHERFEE).Time (Now<NodeSeconds>()).SpendsCoinbase (true ).FromTx (tx));
448- BOOST_REQUIRE (mining->createNewBlock (options));
448+ BOOST_REQUIRE (mining->createNewBlock (options, /* cooldown= */ false ));
449449 }
450450
451451 {
@@ -461,7 +461,7 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::
461461 // give it a fee so it'll get mined
462462 TryAddToMempool (tx_mempool, entry.Fee (LOWFEE).Time (Now<NodeSeconds>()).SpendsCoinbase (false ).FromTx (tx));
463463 // Should throw bad-cb-multiple
464- BOOST_CHECK_EXCEPTION (mining->createNewBlock (options), std::runtime_error, HasReason (" bad-cb-multiple" ));
464+ BOOST_CHECK_EXCEPTION (mining->createNewBlock (options, /* cooldown= */ false ), std::runtime_error, HasReason (" bad-cb-multiple" ));
465465 }
466466
467467 {
@@ -478,7 +478,7 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::
478478 tx.vout [0 ].scriptPubKey = CScript () << OP_2;
479479 hash = tx.GetHash ();
480480 TryAddToMempool (tx_mempool, entry.Fee (HIGHFEE).Time (Now<NodeSeconds>()).SpendsCoinbase (true ).FromTx (tx));
481- BOOST_CHECK_EXCEPTION (mining->createNewBlock (options), std::runtime_error, HasReason (" bad-txns-inputs-missingorspent" ));
481+ BOOST_CHECK_EXCEPTION (mining->createNewBlock (options, /* cooldown= */ false ), std::runtime_error, HasReason (" bad-txns-inputs-missingorspent" ));
482482 }
483483
484484 {
@@ -498,7 +498,7 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::
498498 next->BuildSkip ();
499499 m_node.chainman ->ActiveChain ().SetTip (*next);
500500 }
501- BOOST_REQUIRE (mining->createNewBlock (options));
501+ BOOST_REQUIRE (mining->createNewBlock (options, /* cooldown= */ false ));
502502 // Extend to a 210000-long block chain.
503503 while (m_node.chainman ->ActiveChain ().Tip ()->nHeight < 210000 ) {
504504 CBlockIndex* prev = m_node.chainman ->ActiveChain ().Tip ();
@@ -510,7 +510,7 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::
510510 next->BuildSkip ();
511511 m_node.chainman ->ActiveChain ().SetTip (*next);
512512 }
513- BOOST_REQUIRE (mining->createNewBlock (options));
513+ BOOST_REQUIRE (mining->createNewBlock (options, /* cooldown= */ false ));
514514
515515 // invalid p2sh txn in tx_mempool, template creation fails
516516 tx.vin [0 ].prevout .hash = txFirst[0 ]->GetHash ();
@@ -526,7 +526,7 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::
526526 tx.vout [0 ].nValue -= LOWFEE;
527527 hash = tx.GetHash ();
528528 TryAddToMempool (tx_mempool, entry.Fee (LOWFEE).Time (Now<NodeSeconds>()).SpendsCoinbase (false ).FromTx (tx));
529- BOOST_CHECK_EXCEPTION (mining->createNewBlock (options), std::runtime_error, HasReason (" block-script-verify-flag-failed" ));
529+ BOOST_CHECK_EXCEPTION (mining->createNewBlock (options, /* cooldown= */ false ), std::runtime_error, HasReason (" block-script-verify-flag-failed" ));
530530
531531 // Delete the dummy blocks again.
532532 while (m_node.chainman ->ActiveChain ().Tip ()->nHeight > nHeight) {
@@ -632,7 +632,7 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::
632632 tx.vin [0 ].nSequence = CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG | 1 ;
633633 BOOST_CHECK (!TestSequenceLocks (CTransaction{tx}, tx_mempool)); // Sequence locks fail
634634
635- auto block_template = mining->createNewBlock (options);
635+ auto block_template = mining->createNewBlock (options, /* cooldown= */ false );
636636 BOOST_REQUIRE (block_template);
637637
638638 // None of the of the absolute height/time locked tx should have made
@@ -649,7 +649,7 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::
649649 m_node.chainman ->ActiveChain ().Tip ()->nHeight ++;
650650 SetMockTime (m_node.chainman ->ActiveChain ().Tip ()->GetMedianTimePast () + 1 );
651651
652- block_template = mining->createNewBlock (options);
652+ block_template = mining->createNewBlock (options, /* cooldown= */ false );
653653 BOOST_REQUIRE (block_template);
654654 block = block_template->getBlock ();
655655 BOOST_CHECK_EQUAL (block.vtx .size (), 5U );
@@ -725,7 +725,7 @@ void MinerTestingSetup::TestPrioritisedMining(const CScript& scriptPubKey, const
725725 Txid hashFreeGrandchild = tx.GetHash ();
726726 TryAddToMempool (tx_mempool, entry.Fee (0 ).SpendsCoinbase (false ).FromTx (tx));
727727
728- auto block_template = mining->createNewBlock (options);
728+ auto block_template = mining->createNewBlock (options, /* cooldown= */ false );
729729 BOOST_REQUIRE (block_template);
730730 CBlock block{block_template->getBlock ()};
731731 BOOST_REQUIRE_EQUAL (block.vtx .size (), 6U );
@@ -755,7 +755,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
755755 options.include_dummy_extranonce = true ;
756756
757757 // Create and check a simple template
758- std::unique_ptr<BlockTemplate> block_template = mining->createNewBlock (options);
758+ std::unique_ptr<BlockTemplate> block_template = mining->createNewBlock (options, /* cooldown= */ false );
759759 BOOST_REQUIRE (block_template);
760760 {
761761 CBlock block{block_template->getBlock ()};
@@ -806,7 +806,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
806806 * set at the end of the previous loop.
807807 */
808808 if (current_height % 2 == 0 ) {
809- block_template = mining->createNewBlock (options);
809+ block_template = mining->createNewBlock (options, /* cooldown= */ false );
810810 BOOST_REQUIRE (block_template);
811811 }
812812
0 commit comments