aboutsummaryrefslogtreecommitdiff
path: root/src/script/script.h
Commit message (Collapse)AuthorAgeFilesLines
* [MOVEONLY] Turn CScript::GetOp2 into a function and move to cppPieter Wuille2018-04-131-53/+4
|
* [MOVEONLY] Move CSCript::FindAndDelete to interpreterPieter Wuille2018-04-131-28/+0
|
* Delete unused non-const-iterator CSCript::GetOp overloadsPieter Wuille2018-04-131-17/+0
|
* Make iterators in CScript::FindAndDelete constPieter Wuille2018-04-131-3/+3
|
* Drop dead code CScript::FindBen Woosley2018-04-121-9/+0
| | | | Last use removed in 922e8e2929a2e78270868385aa46f96002fbcff3 (2012!)
* Support serialization as another type without castingPieter Wuille2018-03-201-1/+1
| | | | | | | | | This adds a READWRITEAS(type, obj) macro which serializes obj as if it were casted to (const type&) when const, and to (type&) when non-const. This makes it usable in serialization code that uses a single implementation for both serialization and deserializing, which doesn't know the constness of the object involved.
* Merge #10498: Use static_cast instead of C-style casts for non-fundamental typesMarcoFalke2018-02-071-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9ad6746ccd Use static_cast instead of C-style casts for non-fundamental types (practicalswift) Pull request description: A C-style cast is equivalent to try casting in the following order: 1. `const_cast(...)` 2. `static_cast(...)` 3. `const_cast(static_cast(...))` 4. `reinterpret_cast(...)` 5. `const_cast(reinterpret_cast(...))` By using `static_cast<T>(...)` explicitly we avoid the possibility of an unintentional and dangerous `reinterpret_cast`. Furthermore `static_cast<T>(...)` allows for easier grepping of casts. For a more thorough discussion, see ["ES.49: If you must use a cast, use a named cast"](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es49-if-you-must-use-a-cast-use-a-named-cast) in the C++ Core Guidelines (Stroustrup & Sutter). Tree-SHA512: bd6349b7ea157da93a47b8cf238932af5dff84731374ccfd69b9f732fabdad1f9b1cdfca67497040f14eaa85346391404f4c0495e22c467f26ca883cd2de4d3c
| * Use static_cast instead of C-style casts for non-fundamental typespracticalswift2017-09-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A C-style cast is equivalent to try casting in the following order: 1. const_cast(...) 2. static_cast(...) 3. const_cast(static_cast(...)) 4. reinterpret_cast(...) 5. const_cast(reinterpret_cast(...)) By using static_cast<T>(...) explicitly we avoid the possibility of an unintentional and dangerous reinterpret_cast. Furthermore static_cast<T>(...) allows for easier grepping of casts.
* | Increment MIT Licence copyright header year on files modified in 2017Akira Takizawa2018-01-031-1/+1
| |
* | scripted-diff: Replace #include "" with #include <> (ryanofsky)MeshCollider2017-11-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -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-
* | Fix invalid memory access in CScript::operator+=Anthony Towns2017-09-111-0/+1
|/
* Merge #11011: [Trivial] Add a comment on the use of prevector in script.MarcoFalke2017-08-161-0/+6
|\ | | | | | | | | | | | | | | 08f71c29e [Trivial] Add a comment on the use of prevector in script. (Gregory Maxwell) Pull request description: Tree-SHA512: 020981516e67e576685eb9a8532178fb97d1780af409fc86d869cd05c293c0c823c26e838cf544d18610f5a3f479ce3e47d2ccb95fb1c4e55fe9e7ceb354f20b
| * [Trivial] Add a comment on the use of prevector in script.Gregory Maxwell2017-08-121-0/+6
| |
* | scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal ↵practicalswift2017-08-071-2/+2
|/ | | | | | | | | | | | | 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-0/+8
|
* Merge #10534: Clarify prevector::erase and avoid swap-to-clearWladimir J. van der Laan2017-06-131-2/+3
|\ | | | | | | | | | | e241a63 Clarify prevector::erase and avoid swap-to-clear (Pieter Wuille) Tree-SHA512: fa7602038feb4417158df13ee7c0351673acf38f8a824e75889710344c46a9b8d5f6059faeb521f73e48b7ad3e1a238a9e433e4b44f7c3b9085ff08ef65271fa
| * Clarify prevector::erase and avoid swap-to-clearPieter Wuille2017-06-091-2/+3
| |
* | Sanity check transaction scripts in DecodeHexTxAndrew Chow2017-06-071-0/+3
| | | | | | | | Make sure that the scripts of decoded transactions are valid scripts.
* | Add a valid opcode sanity check to CScriptAndrew Chow2017-06-071-0/+3
|/ | | | | | Added a function in CScript that checks if the script contains valid opcodes. Add a test for that function
* Add constant for maximum stack sizeGregory Sanders2017-05-021-0/+3
|
* Merge #8808: Do not shadow variables (gcc set)Wladimir J. van der Laan2017-03-031-6/+6
|\ | | | | | | | | | | | | ad1ae7a Check and enable -Wshadow by default. (Pavel Janík) 9de90bb Do not shadow variables (gcc set) (Pavel Janík) Tree-SHA512: 9517feb423dc8ddd63896016b25324673bfbe0bffa97f22996f59d7a3fcbdc2ebf2e43ac02bc067546f54e293e9b2f2514be145f867321e9031f895c063d9fb8
| * Do not shadow variables (gcc set)Pavel Janík2016-12-051-6/+6
| |
* | Increment MIT Licence copyright header year on files modified in 2016isle29832016-12-311-1/+1
| | | | | | | | | | | | Edited via: $ contrib/devtools/copyright_header.py update .
* | Make CScript (and prevector) c++11 movable.Pieter Wuille2016-12-211-1/+0
| | | | | | | | | | Such moves are used when reallocating vectors that contain them, for example.
* | Move CTxInWitness inside CTxInPieter Wuille2016-12-041-0/+2
|/
* Rename OP_NOP3 to OP_CHECKSEQUENCEVERIFYBtcDrak2016-06-281-2/+2
|
* [RPC] signrawtransaction can sign P2WSHNicolasDorier2016-06-221-0/+1
|
* BIP141: Witness programPieter Wuille2016-06-221-0/+1
|
* BIP144: Serialization, hashes, relay (sender side)Pieter Wuille2016-06-221-0/+14
| | | | | | Contains refactorings by Eric Lombrozo. Contains fixup by Nicolas Dorier. Contains cleanup of CInv::GetCommand by Alex Morcos
* Merge #7907: Optimize and Cleanup CScript::FindAndDeleteWladimir J. van der Laan2016-05-051-3/+12
|\ | | | | | | | | | | | | d1d7775 Improve worst-case behavior of CScript::FindAndDelete (Patrick Strateman) e2a30bc Unit test for CScript::FindAndDelete (Gavin Andresen) c0f660c Replace c-style cast with c++ style static_cast. (Patrick Strateman) ec9ad5f Replace memcmp with std::equal in CScript::FindAndDelete (Patrick Strateman)
| * Improve worst-case behavior of CScript::FindAndDeletePatrick Strateman2016-04-211-2/+11
| | | | | | | | Thanks to Sergio Lerner for identifying this issue and suggesting this kind of solution.
| * Replace c-style cast with c++ style static_cast.Patrick Strateman2016-04-191-1/+1
| |
| * Replace memcmp with std::equal in CScript::FindAndDeletePatrick Strateman2016-04-191-1/+1
| | | | | | | | Function is stl; std::equal just makes more sense.
* | Treat overly long scriptPubKeys as unspendablePieter Wuille2016-04-251-1/+1
| |
* | Introduce constant for maximum CScript lengthPieter Wuille2016-04-251-0/+3
|/
* BIP112: Implement CHECKSEQUENCEVERIFYMark Friedenbach2016-02-141-0/+12
| | | | | | | | | | - 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 pull request #7205Wladimir J. van der Laan2016-01-051-1/+1
|\ | | | | | | | | | | fa71669 [devtools] Use git pretty-format for year parsing (MarcoFalke) fa24439 Bump copyright headers to 2015 (MarcoFalke) fa6ad85 [devtools] Rewrite fix-copyright-headers.py (MarcoFalke)
| * Bump copyright headers to 2015MarcoFalke2015-12-131-1/+1
| |
* | Rename OP_NOP2 to OP_CHECKLOCKTIMEVERIFY.mb300sd2015-12-151-2/+2
|/
* Prevector typePieter Wuille2015-11-131-5/+9
|
* script: Remove magic numbersDavid Hill2015-10-151-1/+8
| | | | | This adds two new constants, MAX_OPS_PER_SCRIPT and MAX_PUBKEYS_PER_MULTISIG.
* Accept any sequence of PUSHDATAs in OP_RETURN outputsPeter Todd2015-10-011-1/+0
| | | | | | | | | | | | Previously only one PUSHDATA was allowed, needlessly limiting applications such as matching OP_RETURN contents with bloom filters that operate on a per-PUSHDATA level. Now any combination that passes IsPushOnly() is allowed, so long as the total size of the scriptPubKey is less than 42 bytes. (unchanged modulo non-minimal PUSHDATA encodings) Also, this fixes the odd bug where previously the PUSHDATA could be replaced by any single opcode, even sigops consuming opcodes such as CHECKMULTISIG. (20 sigops!)
* Add IsPushOnly(const_iterator pc)Peter Todd2015-10-011-0/+1
| | | | | Allows IsPushOnly() to be applied to just part of the script for OP_RETURN outputs.
* Resolve issue 3166.mruddy2015-07-301-1/+0
| | | | | 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.
* Separate core memory usage computation in core_memusage.hPieter Wuille2015-07-201-3/+0
|
* Implement accurate memory accounting for mempoolPieter Wuille2015-07-101-0/+3
|
* add CReserveScript to allow modular script keeping/returningJonas Schnelli2015-07-011-0/+9
| | | | - use one CReserveScript per mining thread
* Merge pull request #6124Wladimir J. van der Laan2015-06-261-3/+9
|\ | | | | | | | | | | | | ffd75ad Enable CHECKLOCKTIMEVERIFY as a standard script verify flag (Peter Todd) bc60b2b Replace NOP2 with CHECKLOCKTIMEVERIFY (BIP65) (Peter Todd) 48e9c57 Move LOCKTIME_THRESHOLD to src/script/script.h (Peter Todd) 99088d6 Make CScriptNum() take nMaxNumSize as an argument (Peter Todd)
| * Replace NOP2 with CHECKLOCKTIMEVERIFY (BIP65)Peter Todd2015-06-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <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.
| * Move LOCKTIME_THRESHOLD to src/script/script.hPeter Todd2015-05-091-0/+4
| | | | | | | | Will now be needed by CHECKLOCKTIMEVERIFY code.