Precompute sighashes

Original version by Nicolas Dorier. Precomputing version by Pieter Wuille.

Edited for Zcash by Ariel Gabizon and Jack Grigg
This commit is contained in:
Pieter Wuille
2018-01-01 13:27:59 +02:00
committed by Jack Grigg
parent 722d811f89
commit f762d44973
10 changed files with 84 additions and 38 deletions

View File

@@ -293,7 +293,8 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
// policy here, but we still have to ensure that the block we
// create only contains transactions that are valid in new blocks.
CValidationState state;
if (!ContextualCheckInputs(tx, state, view, true, MANDATORY_SCRIPT_VERIFY_FLAGS, true, Params().GetConsensus()))
CachedHashes cachedHashes(tx);
if (!ContextualCheckInputs(tx, state, view, true, MANDATORY_SCRIPT_VERIFY_FLAGS, true, cachedHashes, Params().GetConsensus()))
continue;
UpdateCoins(tx, view, nHeight);