diff options
| author | Pieter Wuille <[email protected]> | 2016-09-01 12:09:36 +0200 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2016-09-01 12:20:43 +0200 |
| commit | 19b0f33de0efd9da788e8e4f3fdc2a9e159abdb1 (patch) | |
| tree | 042f12d404c93d7739a0968cd2258f9222ad19f1 /src/script/bitcoinconsensus.cpp | |
| parent | Merge #8612: Check for compatibility with download in FindNextBlocksToDownload (diff) | |
| parent | Rename to PrecomputedTransactionData (diff) | |
| download | discoin-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.cpp | 4 |
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 } |