@@ -335,23 +335,6 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
335
335
BOOST_CHECK_THROW (AssemblerForTest (chainparams).CreateNewBlock (scriptPubKey), std::runtime_error);
336
336
mempool.clear ();
337
337
338
- // invalid (pre-p2sh) txn in mempool, template creation fails
339
- tx.vin [0 ].prevout .hash = txFirst[0 ]->GetHash ();
340
- tx.vin [0 ].prevout .n = 0 ;
341
- tx.vin [0 ].scriptSig = CScript () << OP_1;
342
- tx.vout [0 ].nValue = BLOCKSUBSIDY-LOWFEE;
343
- script = CScript () << OP_0;
344
- tx.vout [0 ].scriptPubKey = GetScriptForDestination (CScriptID (script));
345
- hash = tx.GetHash ();
346
- mempool.addUnchecked (hash, entry.Fee (LOWFEE).Time (GetTime ()).SpendsCoinbase (true ).FromTx (tx));
347
- tx.vin [0 ].prevout .hash = hash;
348
- tx.vin [0 ].scriptSig = CScript () << std::vector<unsigned char >(script.begin (), script.end ());
349
- tx.vout [0 ].nValue -= LOWFEE;
350
- hash = tx.GetHash ();
351
- mempool.addUnchecked (hash, entry.Fee (LOWFEE).Time (GetTime ()).SpendsCoinbase (false ).FromTx (tx));
352
- BOOST_CHECK_THROW (AssemblerForTest (chainparams).CreateNewBlock (scriptPubKey), std::runtime_error);
353
- mempool.clear ();
354
-
355
338
// double spend txn pair in mempool, template creation fails
356
339
tx.vin [0 ].prevout .hash = txFirst[0 ]->GetHash ();
357
340
tx.vin [0 ].scriptSig = CScript () << OP_1;
@@ -391,6 +374,24 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
391
374
chainActive.SetTip (next);
392
375
}
393
376
BOOST_CHECK (pblocktemplate = AssemblerForTest (chainparams).CreateNewBlock (scriptPubKey));
377
+
378
+ // invalid p2sh txn in mempool, template creation fails
379
+ tx.vin [0 ].prevout .hash = txFirst[0 ]->GetHash ();
380
+ tx.vin [0 ].prevout .n = 0 ;
381
+ tx.vin [0 ].scriptSig = CScript () << OP_1;
382
+ tx.vout [0 ].nValue = BLOCKSUBSIDY-LOWFEE;
383
+ script = CScript () << OP_0;
384
+ tx.vout [0 ].scriptPubKey = GetScriptForDestination (CScriptID (script));
385
+ hash = tx.GetHash ();
386
+ mempool.addUnchecked (hash, entry.Fee (LOWFEE).Time (GetTime ()).SpendsCoinbase (true ).FromTx (tx));
387
+ tx.vin [0 ].prevout .hash = hash;
388
+ tx.vin [0 ].scriptSig = CScript () << std::vector<unsigned char >(script.begin (), script.end ());
389
+ tx.vout [0 ].nValue -= LOWFEE;
390
+ hash = tx.GetHash ();
391
+ mempool.addUnchecked (hash, entry.Fee (LOWFEE).Time (GetTime ()).SpendsCoinbase (false ).FromTx (tx));
392
+ BOOST_CHECK_THROW (AssemblerForTest (chainparams).CreateNewBlock (scriptPubKey), std::runtime_error);
393
+ mempool.clear ();
394
+
394
395
// Delete the dummy blocks again.
395
396
while (chainActive.Tip ()->nHeight > nHeight) {
396
397
CBlockIndex* del = chainActive.Tip ();
0 commit comments