mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 07:39:08 +01:00
test: P2SH sig ops are only counted with SCRIPT_VERIFY_P2SH flag
This commit is contained in:
@@ -151,6 +151,9 @@ BOOST_AUTO_TEST_CASE(GetTxSigOpCost)
|
||||
BuildTxs(spendingTx, coins, creationTx, scriptPubKey, scriptSig, CScriptWitness());
|
||||
assert(GetTransactionSigOpCost(CTransaction(spendingTx), coins, flags) == 2 * WITNESS_SCALE_FACTOR);
|
||||
assert(VerifyWithFlag(CTransaction(creationTx), spendingTx, flags) == SCRIPT_ERR_CHECKMULTISIGVERIFY);
|
||||
|
||||
// P2SH sigops are not counted if we don't set the SCRIPT_VERIFY_P2SH flag
|
||||
assert(GetTransactionSigOpCost(CTransaction(spendingTx), coins, /*flags=*/0) == 0);
|
||||
}
|
||||
|
||||
// P2WPKH witness program
|
||||
|
||||
Reference in New Issue
Block a user