aboutsummaryrefslogtreecommitdiff
path: root/src/script
Commit message (Collapse)AuthorAgeFilesLines
* Ensure `-maxsigcachesize` is in valid rangeJohn Newbery2017-02-172-2/+5
| | | | | | | - If the -maxsigcachesize parameter is set to zero, setup a minimum sized sigcache (2 elements) rather than segfaulting. - Handle maxsigcachesize being negative - Handle maxsigcachesize being too large
* [trivial] Fix typos in commentspracticalswift2017-01-271-1/+1
|
* Increment MIT Licence copyright header year on files modified in 2016isle29832016-12-3113-13/+13
| | | | | | 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.
* Merge #8589: Inline CTxInWitness inside CTxInWladimir J. van der Laan2016-12-213-8/+6
|\ | | | | | | f6fb7ac Move CTxInWitness inside CTxIn (Pieter Wuille)
| * Move CTxInWitness inside CTxInPieter Wuille2016-12-043-8/+6
| |
* | Merge #8895: Better SigCache ImplementationPieter Wuille2016-12-142-41/+45
|\ \ | | | | | | | | | | | | 67dac4e Add unit tests for the CuckooCache (Jeremy Rubin) c9e69fb Add CuckooCache implementation and replace the sigcache map_type with it (Jeremy Rubin)
| * | Add CuckooCache implementation and replace the sigcache map_type with itJeremy Rubin2016-12-142-41/+45
| | | | | | | | | | | | | | | | | | | | | | | | SQUASHME: Change cuckoocache to only work for powers of two, to avoid mod operator SQUASHME: Update Documentation and simplify logarithm logic SQUASHME: OSX Build Errors SQUASHME: minor Feedback from sipa + bluematt SQUASHME: DOCONLY: Clarify a few comments.
* | | Refactor: Removed begin/end_ptr functions.Karl-Johan Alm2016-12-091-5/+5
| |/ |/|
* | Make CTransaction actually immutablePieter Wuille2016-12-021-2/+1
| |
* | Get rid of nType and nVersionPieter Wuille2016-11-072-16/+18
| | | | | | | | | | | | | | | | | | | | | | 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.
* | Make GetSerializeSize a wrapper on top of CSizeComputerPieter Wuille2016-11-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | Given that in default GetSerializeSize implementations created by ADD_SERIALIZE_METHODS we're already using CSizeComputer(), get rid of the specialized GetSerializeSize methods everywhere, and just use CSizeComputer. This removes a lot of code which isn't actually used anywhere. For CCompactSize and CVarInt this actually removes a more efficient size computing algorithm, which is brought back in a later commit.
* | Make streams' read and write return voidPieter Wuille2016-11-071-2/+1
| | | | | | | | | | | | | | | | The stream implementations had two cascading layers (the upper one with operator<< and operator>>, and a lower one with read and write). The lower layer's functions are never cascaded (nor should they, as they should only be used from the higher layer), so make them return void instead.
* | libconsensus: Add input validation of flagsWladimir J. van der Laan2016-10-202-0/+13
|/ | | | | | | | | | | | | Makes it an error to use flags that have not been defined on the libconsensus API. There has been some confusion as to what pass to libconsensus, and (combined with mention in the release notes) this should clear it up. Using undocumented flags is a risk because their meaning, and what combinations are allowed, changes from release to release. E.g. it is no longer possible to pass (CLEANSTACK | P2SH) without running into an assertion after the segwit changes.
* 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
| |
* | Fix ismine and addwitnessaddress: no uncompressed keys in segwitPieter Wuille2016-10-172-10/+63
| |
* | Require compressed keys in segwit as policy and disable signing with ↵Johnson Lau2016-10-165-8/+35
|/ | | | uncompressed keys for segwit scripts
* Add NULLDUMMY verify flag in bitcoinconsensus.hJohnson Lau2016-09-301-1/+2
|
* Add policy: null signature for failed CHECK(MULTI)SIGJohnson Lau2016-09-274-1/+20
|
* Make non-minimal OP_IF/NOTIF argument non-standard for P2WSHJohnson Lau2016-09-234-1/+14
|
* Merge #8524: Precompute sighashesPieter Wuille2016-09-014-22/+51
|\ | | | | | | | | | | 35fe039 Rename to PrecomputedTransactionData (Pieter Wuille) ab48c5e Unit test for sighash caching (Nicolas DORIER) d2c5d04 Precompute sighashes (Pieter Wuille)
| * Rename to PrecomputedTransactionDataPieter Wuille2016-08-264-12/+12
| |
| * Precompute sighashesPieter Wuille2016-08-164-22/+51
| | | | | | | | Original version by Nicolas Dorier. Precomputing version by Pieter Wuille.
* | Merge #8607: [doc] Fix doxygen off-by-one comments, fix typosWladimir J. van der Laan2016-08-281-1/+1
|\ \ | |/ |/| | | | | | | | | fafe7b3 contrib: Make fix-copyright-headers.py more portable (MarcoFalke) fa27c0a [doc] Fix typos in comments, doxygen: Fix comment syntax (MarcoFalke) fabfd5d [qa] pull-tester: Don't mute zmq ImportError (MarcoFalke) 67a5502 init: Fix typo in help message for -whitelistforcerelay (Wladimir J. van der Laan)
| * [doc] Fix typos in comments, doxygen: Fix comment syntaxMarcoFalke2016-08-221-1/+1
| |
* | libconsensus: Expose a flag for BIP112Jorge Timón2016-07-281-0/+1
| | | | | | | | We added the segwit one, but we forgot CHECKSEQUENCEVERIFY
* | Rename OP_NOP3 to OP_CHECKSEQUENCEVERIFYBtcDrak2016-06-282-3/+3
|/
* [RPC] signrawtransaction can sign P2WSHNicolasDorier2016-06-222-0/+9
|
* BIP143: Signing logicPieter Wuille2016-06-225-94/+282
|
* [libconsensus] Script verification API with amountsThomas Kerin2016-06-222-6/+32
| | | | | | | | | | script_tests: always test bitcoinconsensus_verify_script_with_amount if VERIFY_WITNESS isn't set Rename internal method + make it static trim bitcoinconsensus_ prefix Add SERIALIZE_TRANSACTION_WITNESS flag
* BIP141: Other consensus critical limits, and BIP145Pieter Wuille2016-06-222-0/+49
| | | | Includes changes by Suhas Daftuar, Luke-jr, and mruddy.
* BIP143: Verification logicPieter Wuille2016-06-224-28/+95
| | | | Includes simplifications by Eric Lombrozo.
* Refactor script validation to observe amountsPieter Wuille2016-06-225-6/+10
| | | | This is a preparation for BIP143 support.
* BIP141: Witness programPieter Wuille2016-06-228-6/+163
|
* BIP144: Serialization, hashes, relay (sender side)Pieter Wuille2016-06-222-0/+26
| | | | | | 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-252-1/+4
|/
* wallet_ismine.h → script/ismine.hWladimir J. van der Laan2016-04-182-0/+129
| | | | | | Removes conditional dependency of `src/test` on wallet. Makes multisig and P2SH tests complete without wallet built-in.
* [doc] Fix doxygen comments for membersMarcoFalke2016-04-032-7/+7
|
* 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-144-8/+106
| | | | | | | | | | - 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
| |