aboutsummaryrefslogtreecommitdiff
path: root/src/script/bitcoinconsensus.cpp
diff options
context:
space:
mode:
authorPieter Wuille <[email protected]>2016-09-01 12:09:36 +0200
committerPieter Wuille <[email protected]>2016-09-01 12:20:43 +0200
commit19b0f33de0efd9da788e8e4f3fdc2a9e159abdb1 (patch)
tree042f12d404c93d7739a0968cd2258f9222ad19f1 /src/script/bitcoinconsensus.cpp
parentMerge #8612: Check for compatibility with download in FindNextBlocksToDownload (diff)
parentRename to PrecomputedTransactionData (diff)
downloaddiscoin-19b0f33de0efd9da788e8e4f3fdc2a9e159abdb1.tar.xz
discoin-19b0f33de0efd9da788e8e4f3fdc2a9e159abdb1.zip
Merge #8524: Precompute sighashes
35fe039 Rename to PrecomputedTransactionData (Pieter Wuille) ab48c5e Unit test for sighash caching (Nicolas DORIER) d2c5d04 Precompute sighashes (Pieter Wuille)
Diffstat (limited to 'src/script/bitcoinconsensus.cpp')
-rw-r--r--src/script/bitcoinconsensus.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/script/bitcoinconsensus.cpp b/src/script/bitcoinconsensus.cpp
index 62fd9031f..b629f4278 100644
--- a/src/script/bitcoinconsensus.cpp
+++ b/src/script/bitcoinconsensus.cpp
@@ -84,8 +84,8 @@ static int verify_script(const unsigned char *scriptPubKey, unsigned int scriptP
// Regardless of the verification result, the tx did not error.
set_error(err, bitcoinconsensus_ERR_OK);
-
- return VerifyScript(tx.vin[nIn].scriptSig, CScript(scriptPubKey, scriptPubKey + scriptPubKeyLen), nIn < tx.wit.vtxinwit.size() ? &tx.wit.vtxinwit[nIn].scriptWitness : NULL, flags, TransactionSignatureChecker(&tx, nIn, amount), NULL);
+ PrecomputedTransactionData txdata(tx);
+ return VerifyScript(tx.vin[nIn].scriptSig, CScript(scriptPubKey, scriptPubKey + scriptPubKeyLen), nIn < tx.wit.vtxinwit.size() ? &tx.wit.vtxinwit[nIn].scriptWitness : NULL, flags, TransactionSignatureChecker(&tx, nIn, amount, txdata), NULL);
} catch (const std::exception&) {
return set_error(err, bitcoinconsensus_ERR_TX_DESERIALIZE); // Error deserializing
}