|
|
|
@ -1116,16 +1116,16 @@ bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsVi
@@ -1116,16 +1116,16 @@ bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsVi
|
|
|
|
|
if (fScriptChecks) { |
|
|
|
|
for (unsigned int i = 0; i < tx.vin.size(); i++) { |
|
|
|
|
const COutPoint &prevout = tx.vin[i].prevout; |
|
|
|
|
const CCoins* coins = inputs.AccessCoins(prevout.hash); |
|
|
|
|
assert(coins); |
|
|
|
|
const Coin& coin = inputs.AccessCoin(prevout); |
|
|
|
|
assert(!coin.IsPruned()); |
|
|
|
|
|
|
|
|
|
// We very carefully only pass in things to CScriptCheck which
|
|
|
|
|
// are clearly committed to by tx' witness hash. This provides
|
|
|
|
|
// a sanity check that our caching is not introducing consensus
|
|
|
|
|
// failures through additional data in, eg, the coins being
|
|
|
|
|
// spent being checked as a part of CScriptCheck.
|
|
|
|
|
const CScript& scriptPubKey = coins->vout[prevout.n].scriptPubKey; |
|
|
|
|
const CAmount amount = coins->vout[prevout.n].nValue; |
|
|
|
|
const CScript& scriptPubKey = coin.out.scriptPubKey; |
|
|
|
|
const CAmount amount = coin.out.nValue; |
|
|
|
|
|
|
|
|
|
// Verify signature
|
|
|
|
|
CScriptCheck check(scriptPubKey, amount, tx, i, flags, cacheStore, &txdata); |
|
|
|
|