aboutsummaryrefslogtreecommitdiff
path: root/src/validation.h
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2017-04-27 10:37:33 -0400
committerPieter Wuille <pieter.wuille@gmail.com>2017-06-01 11:56:06 -0700
commitc87b957a32e03c09d410abadf661f87eb813bcdb (patch)
tree2e78ed56ca2d41dcc671b482dab2bb0e21df495e /src/validation.h
parentf68cdfe92b37f5a75be612b7de3c1a03245696d0 (diff)
downloadbitcoin-c87b957a32e03c09d410abadf661f87eb813bcdb.tar.xz
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/validation.h')
-rw-r--r--src/validation.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/validation.h b/src/validation.h
index b19c3ff4f7..8931cfc4d4 100644
--- a/src/validation.h
+++ b/src/validation.h
@@ -404,8 +404,8 @@ private:
public:
CScriptCheck(): amount(0), ptxTo(0), nIn(0), nFlags(0), cacheStore(false), error(SCRIPT_ERR_UNKNOWN_ERROR) {}
- CScriptCheck(const CCoins& txFromIn, const CTransaction& txToIn, unsigned int nInIn, unsigned int nFlagsIn, bool cacheIn, PrecomputedTransactionData* txdataIn) :
- scriptPubKey(txFromIn.vout[txToIn.vin[nInIn].prevout.n].scriptPubKey), amount(txFromIn.vout[txToIn.vin[nInIn].prevout.n].nValue),
+ CScriptCheck(const CScript& scriptPubKeyIn, const CAmount amountIn, const CTransaction& txToIn, unsigned int nInIn, unsigned int nFlagsIn, bool cacheIn, PrecomputedTransactionData* txdataIn) :
+ scriptPubKey(scriptPubKeyIn), amount(amountIn),
ptxTo(&txToIn), nIn(nInIn), nFlags(nFlagsIn), cacheStore(cacheIn), error(SCRIPT_ERR_UNKNOWN_ERROR), txdata(txdataIn) { }
bool operator()();