diff options
| author | Pieter Wuille <[email protected]> | 2017-04-25 11:29:32 -0700 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2017-06-01 11:56:06 -0700 |
| commit | 8b3868c1b4bf89c41b26ecb3a4b7c3a2557e3868 (patch) | |
| tree | 7183c0a73358e4eb26a5d163c18d88be12972631 /src/validation.cpp | |
| parent | Only pass things committed to by tx's witness hash to CScriptCheck (diff) | |
| download | discoin-8b3868c1b4bf89c41b26ecb3a4b7c3a2557e3868.tar.xz discoin-8b3868c1b4bf89c41b26ecb3a4b7c3a2557e3868.zip | |
Switch CScriptCheck to use Coin instead of CCoins
Diffstat (limited to 'src/validation.cpp')
| -rw-r--r-- | src/validation.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index 43d2cf1d6..b295a7f86 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -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); |