@@ -101,7 +101,7 @@ BOOST_FIXTURE_TEST_CASE(tx_mempool_block_doublespend, TestChain100Setup)
101
101
// should fail.
102
102
// Capture this interaction with the upgraded_nop argument: set it when evaluating
103
103
// any script flag that is implemented as an upgraded NOP code.
104
- void ValidateCheckInputsForAllFlags (CMutableTransaction &tx, uint32_t failing_flags, bool add_to_cache, bool upgraded_nop )
104
+ void ValidateCheckInputsForAllFlags (CMutableTransaction &tx, uint32_t failing_flags, bool add_to_cache)
105
105
{
106
106
PrecomputedTransactionData txdata (tx);
107
107
// If we add many more flags, this loop can get too expensive, but we can
@@ -122,12 +122,6 @@ void ValidateCheckInputsForAllFlags(CMutableTransaction &tx, uint32_t failing_fl
122
122
// CheckInputs should succeed iff test_flags doesn't intersect with
123
123
// failing_flags
124
124
bool expected_return_value = !(test_flags & failing_flags);
125
- if (expected_return_value && upgraded_nop) {
126
- // If the script flag being tested corresponds to an upgraded NOP,
127
- // then script execution should fail if DISCOURAGE_UPGRADABLE_NOPS
128
- // is set.
129
- expected_return_value = !(test_flags & SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS);
130
- }
131
125
BOOST_CHECK_EQUAL (ret, expected_return_value);
132
126
133
127
// Test the caching
@@ -213,7 +207,7 @@ BOOST_FIXTURE_TEST_CASE(checkinputs_test, TestChain100Setup)
213
207
// not present. Don't add these checks to the cache, so that we can
214
208
// test later that block validation works fine in the absence of cached
215
209
// successes.
216
- ValidateCheckInputsForAllFlags (spend_tx, SCRIPT_VERIFY_DERSIG | SCRIPT_VERIFY_LOW_S | SCRIPT_VERIFY_STRICTENC, false , false );
210
+ ValidateCheckInputsForAllFlags (spend_tx, SCRIPT_VERIFY_DERSIG | SCRIPT_VERIFY_LOW_S | SCRIPT_VERIFY_STRICTENC, false );
217
211
218
212
// And if we produce a block with this tx, it should be valid (DERSIG not
219
213
// enabled yet), even though there's no cache entry.
@@ -238,7 +232,7 @@ BOOST_FIXTURE_TEST_CASE(checkinputs_test, TestChain100Setup)
238
232
std::vector<unsigned char > vchSig2 (p2pk_scriptPubKey.begin (), p2pk_scriptPubKey.end ());
239
233
invalid_under_p2sh_tx.vin [0 ].scriptSig << vchSig2;
240
234
241
- ValidateCheckInputsForAllFlags (invalid_under_p2sh_tx, SCRIPT_VERIFY_P2SH, true , false );
235
+ ValidateCheckInputsForAllFlags (invalid_under_p2sh_tx, SCRIPT_VERIFY_P2SH, true );
242
236
}
243
237
244
238
// Test CHECKLOCKTIMEVERIFY
@@ -261,7 +255,7 @@ BOOST_FIXTURE_TEST_CASE(checkinputs_test, TestChain100Setup)
261
255
vchSig.push_back ((unsigned char )SIGHASH_ALL);
262
256
invalid_with_cltv_tx.vin [0 ].scriptSig = CScript () << vchSig << 101 ;
263
257
264
- ValidateCheckInputsForAllFlags (invalid_with_cltv_tx, SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY, true , true );
258
+ ValidateCheckInputsForAllFlags (invalid_with_cltv_tx, SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY, true );
265
259
266
260
// Make it valid, and check again
267
261
invalid_with_cltv_tx.vin [0 ].scriptSig = CScript () << vchSig << 100 ;
@@ -289,7 +283,7 @@ BOOST_FIXTURE_TEST_CASE(checkinputs_test, TestChain100Setup)
289
283
vchSig.push_back ((unsigned char )SIGHASH_ALL);
290
284
invalid_with_csv_tx.vin [0 ].scriptSig = CScript () << vchSig << 101 ;
291
285
292
- ValidateCheckInputsForAllFlags (invalid_with_csv_tx, SCRIPT_VERIFY_CHECKSEQUENCEVERIFY, true , true );
286
+ ValidateCheckInputsForAllFlags (invalid_with_csv_tx, SCRIPT_VERIFY_CHECKSEQUENCEVERIFY, true );
293
287
294
288
// Make it valid, and check again
295
289
invalid_with_csv_tx.vin [0 ].scriptSig = CScript () << vchSig << 100 ;
@@ -318,11 +312,11 @@ BOOST_FIXTURE_TEST_CASE(checkinputs_test, TestChain100Setup)
318
312
UpdateTransaction (valid_with_witness_tx, 0 , sigdata);
319
313
320
314
// This should be valid under all script flags.
321
- ValidateCheckInputsForAllFlags (valid_with_witness_tx, 0 , true , false );
315
+ ValidateCheckInputsForAllFlags (valid_with_witness_tx, 0 , true );
322
316
323
317
// Remove the witness, and check that it is now invalid.
324
318
valid_with_witness_tx.vin [0 ].scriptWitness .SetNull ();
325
- ValidateCheckInputsForAllFlags (valid_with_witness_tx, SCRIPT_VERIFY_WITNESS, true , false );
319
+ ValidateCheckInputsForAllFlags (valid_with_witness_tx, SCRIPT_VERIFY_WITNESS, true );
326
320
}
327
321
328
322
{
@@ -347,7 +341,7 @@ BOOST_FIXTURE_TEST_CASE(checkinputs_test, TestChain100Setup)
347
341
}
348
342
349
343
// This should be valid under all script flags
350
- ValidateCheckInputsForAllFlags (tx, 0 , true , false );
344
+ ValidateCheckInputsForAllFlags (tx, 0 , true );
351
345
352
346
// Check that if the second input is invalid, but the first input is
353
347
// valid, the transaction is not cached.
0 commit comments