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/test/script_P2SH_tests.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/test/script_P2SH_tests.cpp')
| -rw-r--r-- | src/test/script_P2SH_tests.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/test/script_P2SH_tests.cpp b/src/test/script_P2SH_tests.cpp index 5224b57ca..1a01593a8 100644 --- a/src/test/script_P2SH_tests.cpp +++ b/src/test/script_P2SH_tests.cpp @@ -107,18 +107,20 @@ BOOST_AUTO_TEST_CASE(sign) } // All of the above should be OK, and the txTos have valid signatures // Check to make sure signature verification fails if we use the wrong ScriptSig: - for (int i = 0; i < 8; i++) + for (int i = 0; i < 8; i++) { + PrecomputedTransactionData txdata(txTo[i]); for (int j = 0; j < 8; j++) { CScript sigSave = txTo[i].vin[0].scriptSig; txTo[i].vin[0].scriptSig = txTo[j].vin[0].scriptSig; - bool sigOK = CScriptCheck(CCoins(txFrom, 0), txTo[i], 0, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC, false)(); + bool sigOK = CScriptCheck(CCoins(txFrom, 0), txTo[i], 0, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC, false, &txdata)(); if (i == j) BOOST_CHECK_MESSAGE(sigOK, strprintf("VerifySignature %d %d", i, j)); else BOOST_CHECK_MESSAGE(!sigOK, strprintf("VerifySignature %d %d", i, j)); txTo[i].vin[0].scriptSig = sigSave; } + } } BOOST_AUTO_TEST_CASE(norecurse) |