aboutsummaryrefslogtreecommitdiff
path: root/src/test/transaction_tests.cpp
diff options
context:
space:
mode:
authorMatt Corallo <[email protected]>2017-04-27 10:37:33 -0400
committerPieter Wuille <[email protected]>2017-06-01 11:56:06 -0700
commitc87b957a32e03c09d410abadf661f87eb813bcdb (patch)
tree2e78ed56ca2d41dcc671b482dab2bb0e21df495e /src/test/transaction_tests.cpp
parentSwitch from per-tx to per-txout CCoinsViewCache methods in some places (diff)
downloaddiscoin-c87b957a32e03c09d410abadf661f87eb813bcdb.tar.xz
discoin-c87b957a32e03c09d410abadf661f87eb813bcdb.zip
Only pass things committed to by tx's witness hash to CScriptCheck
This clarifies a bit more the ways in which the new script execution cache could break consensus in the future if additional data from the CCoins object were to be used as a part of script execution. After this change, any such consensus breaks should be very visible to reviewers, hopefully ensuring no such changes can be made.
Diffstat (limited to 'src/test/transaction_tests.cpp')
-rw-r--r--src/test/transaction_tests.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp
index 665827696..986922b2a 100644
--- a/src/test/transaction_tests.cpp
+++ b/src/test/transaction_tests.cpp
@@ -481,7 +481,8 @@ BOOST_AUTO_TEST_CASE(test_big_witness_transaction) {
for(uint32_t i = 0; i < mtx.vin.size(); i++) {
std::vector<CScriptCheck> vChecks;
- CScriptCheck check(coins, tx, i, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS, false, &txdata);
+ const CTxOut& output = coins.vout[tx.vin[i].prevout.n];
+ CScriptCheck check(output.scriptPubKey, output.nValue, tx, i, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS, false, &txdata);
vChecks.push_back(CScriptCheck());
check.swap(vChecks.back());
control.Add(vChecks);