aboutsummaryrefslogtreecommitdiff
path: root/src/script/interpreter.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge #10657: Utils: Improvements to ECDSA key-handling codeWladimir J. van der Laan2017-12-201-0/+6
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 63179d0 Scope the ECDSA constant sizes to CPubKey / CKey classes (Jack Grigg) 1ce9f0a Ensure that ECDSA constant sizes are correctly-sized (Jack Grigg) 48abe78 Remove redundant `= 0` initialisations (Jack Grigg) 17fa391 Specify ECDSA constant sizes as constants (Jack Grigg) e4a1086 Update Debian copyright list (Jack Grigg) e181dbe Add comments (Jack Grigg) a3603ac Fix potential overflows in ECDSA DER parsers (Jack Grigg) Pull request description: Mostly trivial, but includes fixes to potential overflows in the ECDSA DER parsers. Cherry-picked from Zcash PR https://github.com/zcash/zcash/pull/2335 Tree-SHA512: 8fcbd51b0bd6723e5d33fa5d592f7cb68ed182796a9b837ecc8217991ad69d6c970258617dc00eb378c8caa4cec5d6b304d9d2c066acd40cda98e4da68e0caa4
| * Add commentsJack Grigg2017-07-171-0/+6
| |
* | Merge #10574: Remove includes in .cpp files for things the corresponding .h ↵Wladimir J. van der Laan2017-12-121-1/+0
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | file already included a720b92 Remove includes in .cpp files for things the corresponding .h file already included (practicalswift) Pull request description: Remove includes in .cpp files for things the corresponding .h file already included. Example case: * `addrdb.cpp` includes `addrdb.h` and `fs.h` * `addrdb.h` includes `fs.h` Then remove the direct inclusion of `fs.h` in `addrman.cpp` and rely on the indirect inclusion of `fs.h` via the included `addrdb.h`. In line with the header include guideline (see #10575). Tree-SHA512: 8704b9de3011a4c234db336a39f7d2c139e741cf0f7aef08a5d3e05197e1e18286b863fdab25ae9638af4ff86b3d52e5cab9eed66bfa2476063aa5c79f9b0346
| * | Remove includes in .cpp files for things the corresponding .h file already ↵practicalswift2017-11-161-1/+0
| | | | | | | | | | | | included
* | | Merge #10699: Make all script validation flags backward compatibleWladimir J. van der Laan2017-12-121-6/+0
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 01013f5 Simplify tx validation tests (Pieter Wuille) 2dd6f80 Add a test that all flags are softforks (Pieter Wuille) 2851b77 Make all script verification flags softforks (Pieter Wuille) Pull request description: This change makes `SCRIPT_VERIFY_UPGRADABLE_NOPS` not apply to `OP_CHECKLOCKTIMEVERIFY` and `OP_CHECKSEQUENCEVERIFY`. This is a no-op as `UPGRADABLE_NOPS` is only set for mempool transactions, and those always have `SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY` and `SCRIPT_VERIFY_CHECKSEQUENCEVERIFY` set as well. The advantage is that setting more flags now always results in a reduction in acceptable scripts (=softfork). This results in a nice and testable property for validation, for which a new test is added. This also means that the introduction of a new definition for a NOP or witness version will likely need the following procedure (example OP_NOP8 here) * Remove OP_NOP8 from being affected by `SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS`. * Add a `SCRIPT_VERIFY_DISCOURAGE_NOP8`, which only applies to `OP_NOP8`. * Add a `SCRIPT_VERIFY_NOP8` which implements the new consensus logic. * Before activation, add `SCRIPT_VERIFY_DISCOURAGE_NOP8` to the mempool flags. * After activation, add `SCRIPT_VERIFY_NOP8` to both the mempool and consensus flags. Tree-SHA512: d3b4538986ecf646aac9dba13a8d89318baf9e308e258547ca3b99e7c0509747f323edac6b1fea4e87e7d3c01b71193794b41679ae4f86f6e11ed6be3fd62c72
| * | Make all script verification flags softforksPieter Wuille2017-06-301-6/+0
| | |
* | | scripted-diff: Replace #include "" with #include <> (ryanofsky)MeshCollider2017-11-161-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -BEGIN VERIFY SCRIPT- for f in \ src/*.cpp \ src/*.h \ src/bench/*.cpp \ src/bench/*.h \ src/compat/*.cpp \ src/compat/*.h \ src/consensus/*.cpp \ src/consensus/*.h \ src/crypto/*.cpp \ src/crypto/*.h \ src/crypto/ctaes/*.h \ src/policy/*.cpp \ src/policy/*.h \ src/primitives/*.cpp \ src/primitives/*.h \ src/qt/*.cpp \ src/qt/*.h \ src/qt/test/*.cpp \ src/qt/test/*.h \ src/rpc/*.cpp \ src/rpc/*.h \ src/script/*.cpp \ src/script/*.h \ src/support/*.cpp \ src/support/*.h \ src/support/allocators/*.h \ src/test/*.cpp \ src/test/*.h \ src/wallet/*.cpp \ src/wallet/*.h \ src/wallet/test/*.cpp \ src/wallet/test/*.h \ src/zmq/*.cpp \ src/zmq/*.h do base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f done -END VERIFY SCRIPT-
* | | Merge #9572: Skip witness sighash cache for non-segwit transactionsWladimir J. van der Laan2017-10-051-6/+11
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 0da49b5 Skip precompute sighash for transactions without witness (Johnson Lau) Pull request description: This saves unnecessary hash caching for non-segwit transactions, but I am not sure if the difference is noticeable. Tree-SHA512: 5cd733a729a52a45781510b3572b26e76837a94155caa14311c6d23a27a12e9613ff278dfc2592e21f640202782f22c5ad00fca85c4de5efacaa617c48ccb08d
| * | | Skip precompute sighash for transactions without witnessJohnson Lau2017-01-191-6/+11
| | | |
* | | | script: Change SignatureHash input index check to an assert.Jim Posen2017-09-271-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | In the SignatureHash function, the input index must refer to a valid index. This is not enforced equally in the segwit/non-segwit branches and should be an assertion rather than returning a error hash.
* | | | Changing &vec[0] to vec.data(), what 9804 missedMeshCollider2017-09-081-1/+1
| | | |
* | | | scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal ↵practicalswift2017-08-071-1/+1
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instead of the macro NULL -BEGIN VERIFY SCRIPT- sed -i 's/\<NULL\>/nullptr/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h src/qt/*/*.cpp src/qt/*/*.h src/wallet/*/*.cpp src/wallet/*/*.h src/support/allocators/*.h sed -i 's/Prefer nullptr, otherwise SAFECOOKIE./Prefer NULL, otherwise SAFECOOKIE./g' src/torcontrol.cpp sed -i 's/tor: Using nullptr authentication/tor: Using NULL authentication/g' src/torcontrol.cpp sed -i 's/METHODS=nullptr/METHODS=NULL/g' src/test/torcontrol_tests.cpp src/torcontrol.cpp sed -i 's/nullptr certificates/NULL certificates/g' src/qt/paymentserver.cpp sed -i 's/"nullptr"/"NULL"/g' src/torcontrol.cpp src/test/torcontrol_tests.cpp -END VERIFY SCRIPT-
* | | Avoid dereference-of-casted-pointerPieter Wuille2017-07-071-2/+2
| |/ |/|
* | Merge #9544: [trivial] Add end of namespace comments. Improve consistency.Wladimir J. van der Laan2017-06-261-2/+2
|\ \ | | | | | | | | | | | | | | | 5a9b508 [trivial] Add end of namespace comments (practicalswift) Tree-SHA512: 92b0fcae4d1d3f4da9e97569ae84ef2d6e09625a5815cd0e5f0eb6dd2ecba9852fa85c184c5ae9de5117050330ce995e9867b451fa8cd5512169025990541a2b
| * | [trivial] Add end of namespace commentspracticalswift2017-05-311-2/+2
| | |
* | | Merge #10313: [Consensus] Add constant for maximum stack sizePieter Wuille2017-05-231-1/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | cb184b3 Add constant for maximum stack size (Gregory Sanders) Tree-SHA512: 0ec4a28552a6eee7fba8c69278f63c61f095e4ba06cb34456bd0162cd702370d10cca621ae1797a0d5e62fb39814cbb8245d3a7adc007ca39dab7a49cbc925dc
| * | | Add constant for maximum stack sizeGregory Sanders2017-05-021-1/+1
| |/ /
* / / Use range-based for loops (C++11) when looping over vector elementspracticalswift2017-05-191-6/+6
|/ /
* | Remove unused C++ code not covered by unit testspracticalswift2017-04-261-3/+3
| |
* | Refactor: Remove using namespace <xxx> from script/Karl-Johan Alm2017-03-081-14/+12
|/
* Increment MIT Licence copyright header year on files modified in 2016isle29832016-12-311-1/+1
| | | | | | Edited via: $ contrib/devtools/copyright_header.py update .
* Refactor: Removed begin/end_ptr functions.Karl-Johan Alm2016-12-091-5/+5
|
* Get rid of nType and nVersionPieter Wuille2016-11-071-15/+15
| | | | | | | | | | | Remove the nType and nVersion as parameters to all serialization methods and functions. There is only one place where it's read and has an impact (in CAddress), and even there it does not impact any of the recursively invoked serializers. Instead, the few places that need nType or nVersion are changed to read it directly from the stream object, through GetType() and GetVersion() methods which are added to all stream classes.
* Merge #8927: Add script tests for FindAndDelete in pre-segwit and segwit scriptsWladimir J. van der Laan2016-10-191-2/+2
|\ | | | | | | acf853d Add script tests for FindAndDelete in pre-segwit and segwit scripts (Johnson Lau)
| * Add script tests for FindAndDelete in pre-segwit and segwit scriptsJohnson Lau2016-10-161-2/+2
| |
* | Require compressed keys in segwit as policy and disable signing with ↵Johnson Lau2016-10-161-6/+22
|/ | | | uncompressed keys for segwit scripts
* Add policy: null signature for failed CHECK(MULTI)SIGJohnson Lau2016-09-271-1/+13
|
* Make non-minimal OP_IF/NOTIF argument non-standard for P2WSHJohnson Lau2016-09-231-0/+6
|
* Rename to PrecomputedTransactionDataPieter Wuille2016-08-261-3/+3
|
* Precompute sighashesPieter Wuille2016-08-161-17/+37
| | | | Original version by Nicolas Dorier. Precomputing version by Pieter Wuille.
* BIP141: Other consensus critical limits, and BIP145Pieter Wuille2016-06-221-0/+47
| | | | Includes changes by Suhas Daftuar, Luke-jr, and mruddy.
* BIP143: Verification logicPieter Wuille2016-06-221-12/+72
| | | | Includes simplifications by Eric Lombrozo.
* BIP141: Witness programPieter Wuille2016-06-221-2/+109
|
* Introduce constant for maximum CScript lengthPieter Wuille2016-04-251-1/+1
|
* [doc] Fix doxygen comments for membersMarcoFalke2016-04-031-6/+6
|
* Code style fix.BtcDrak2016-02-161-1/+2
| | | | | This if statement is a little obtuse and using braces here improves readability.
* Separate CheckLockTime() and CheckSequence() logicBtcDrak2016-02-141-20/+26
| | | | For the sake of a little repetition, make code more readable.
* BIP112: Implement CHECKSEQUENCEVERIFYMark Friedenbach2016-02-141-7/+82
| | | | | | | | | | - Replace NOP3 with CHECKSEQUENCEVERIFY (BIP112) <nSequence> CHECKSEQUENCEVERIFY -> <nSequence> - Fails if txin.nSequence < nSequence, allowing funds of a txout to be locked for a number of blocks or a duration of time after its inclusion in a block. - Pull most of CheckLockTime() out into VerifyLockTime(), a local function that will be reused for CheckSequence() - Add bitwise AND operator to CScriptNum - Enable CHECKSEQUENCEVERIFY as a standard script verify flag - Transactions that fail CSV verification will be rejected from the mempool, making it easy to test the feature. However blocks containing "invalid" CSV-using transactions will still be accepted; this is *not* the soft-fork required to actually enable CSV for production use.
* Merge #7184: Implement SequenceLocks functions for BIP 68Wladimir J. van der Laan2016-02-121-1/+1
|\ | | | | | | | | | | | | b043c4b fix sdaftuar's nits again (Alex Morcos) a51c79b Bug fix to RPC test (Alex Morcos) da6ad5f Add RPC test exercising BIP68 (mempool only) (Suhas Daftuar) c6c2f0f Implement SequenceLocks functions (Alex Morcos)
| * Implement SequenceLocks functionsAlex Morcos2016-02-101-1/+1
| | | | | | | | | | | | | | SequenceLocks functions are used to evaluate sequence lock times or heights per BIP 68. The majority of this code is copied from maaku in #6312 Further credit: btcdrak, sipa, NicolasDorier
* | Correctly report high-S violationsPieter Wuille2016-02-101-1/+4
| |
* | Bump copyright headers to 2015MarcoFalke2015-12-131-1/+1
|/
* Merge pull request #6914Wladimir J. van der Laan2015-12-011-1/+1
|\ | | | | | | 114b581 Prevector type (Pieter Wuille)
| * Prevector typePieter Wuille2015-11-131-1/+1
| |
* | Switch to libsecp256k1-based validation for ECDSAPieter Wuille2015-11-151-11/+2
|/
* script: Remove magic numbersDavid Hill2015-10-151-3/+3
| | | | | This adds two new constants, MAX_OPS_PER_SCRIPT and MAX_PUBKEYS_PER_MULTISIG.
* Merge pull request #5264Wladimir J. van der Laan2015-09-251-1/+1
|\ | | | | | | af3208b Resolve issue 3166. These changes decode valid SIGHASH types on signatures in assembly (asm) representations of scriptSig scripts. This squashed commit incorporates substantial helpful feedback from jtimon, laanwj, and sipa. (mruddy)
| * Resolve issue 3166.mruddy2015-07-301-1/+1
| | | | | | | | | | These changes decode valid SIGHASH types on signatures in assembly (asm) representations of scriptSig scripts. This squashed commit incorporates substantial helpful feedback from jtimon, laanwj, and sipa.
* | Correct a possibly intentional pun that is nevertheless hard to read: "two ↵Mark Friedenbach2015-08-101-1/+1
|/ | | | times of nLockTime." What is meant is that there are two kinds, or categories of nLockTime.
* Replace NOP2 with CHECKLOCKTIMEVERIFY (BIP65)Peter Todd2015-06-211-2/+81
| | | | | | | | | | | | | | | | <nLockTime> CHECKLOCKTIMEVERIFY -> <nLockTime> Fails if tx.nLockTime < nLockTime, allowing the funds in a txout to be locked until some block height or block time in the future is reached. Only the logic and unittests are implemented; this commit does not have any actual soft-fork logic in it. Thanks to Pieter Wuille for rebase. Credit goes to Gregory Maxwell for the suggestion of comparing the argument against the transaction nLockTime rather than the current time/blockheight directly.