Skip to content

Commit d6aaffc

Browse files
committed
test: check P2SH sigop count for coinbase tx
1 parent 6e5b67a commit d6aaffc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/test/script_p2sh_tests.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,12 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard)
364364
// 22 P2SH sigops for all inputs (1 for vin[0], 6 for vin[3], 15 for vin[4]
365365
BOOST_CHECK_EQUAL(GetP2SHSigOpCount(CTransaction(txTo), coins), 22U);
366366

367+
CMutableTransaction coinbase_tx_mut;
368+
coinbase_tx_mut.vin.resize(1);
369+
CTransaction coinbase_tx{coinbase_tx_mut};
370+
BOOST_CHECK(coinbase_tx.IsCoinBase());
371+
BOOST_CHECK_EQUAL(GetP2SHSigOpCount(coinbase_tx, coins), 0U);
372+
367373
CMutableTransaction txToNonStd1;
368374
txToNonStd1.vout.resize(1);
369375
txToNonStd1.vout[0].scriptPubKey = GetScriptForDestination(PKHash(key[1].GetPubKey()));

0 commit comments

Comments
 (0)