aboutsummaryrefslogtreecommitdiff
path: root/src/script/interpreter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Merge pull request #5713Wladimir J. van der Laan2015-02-031-63/+63
|\ | | | | | | | | | | | | | | bf6cdeb Increase coverage of DERSIG edge cases (Pieter Wuille) 819bcf9 Add RPC test for DERSIG BIP switchover logic (Pieter Wuille) 5a47811 BIP66 changeover logic (Pieter Wuille) 092e9fe Example unit tests from BIP66 (Pieter Wuille) 80ad135 Change IsDERSignature to BIP66 implementation (Pieter Wuille)
| * Change IsDERSignature to BIP66 implementationPieter Wuille2015-02-011-63/+63
| |
* | Avoid storing a reference passed to SignatureChecker constructorsPieter Wuille2015-02-021-1/+1
| |
* | Use separate SignatureChecker for CMutableTransactionPieter Wuille2015-02-021-2/+2
| |
* | Remove whitespaces before double colon in errors and logsPavel Janík2015-01-311-1/+1
|/
* Make empty byte arrays pass CheckSignatureEncoding()Peter Todd2015-01-091-0/+5
| | | | | | | | | | | | Makes it possible to compactly provide a delibrately invalid signature for use with CHECK(MULTI)SIG. For instance with BIP19 if m != n invalid signatures need to be provided in the scriptSig; prior to this change those invalid signatures would need to be large DER-encoded signatures. Note that we may want to further expand on this change in the future by saying that only OP_0 is a "valid" invalid signature; BIP19 even with this change is inherently malleable as the invalid signatures can be any validly encoded DER signature.
* Merge pull request #5143Wladimir J. van der Laan2015-01-081-10/+22
|\ | | | | | | | | | | da918ac Make SCRIPT_VERIFY_CLEANSTACK a standardness requirement (Pieter Wuille) b6e03cc Add SCRIPT_VERIFY_CLEANSTACK (BIP62 rule 6) (Pieter Wuille) ae4151b No semantic change: reuse stack variable in P2SH evaluation (Pieter Wuille)
| * Add SCRIPT_VERIFY_CLEANSTACK (BIP62 rule 6)Pieter Wuille2014-11-251-3/+12
| | | | | | | | | | Based on an earlier patch by Peter Todd, though the rules here are different (P2SH scripts should not have a CLEANSTACK check before the P2SH evaluation).
| * No semantic change: reuse stack variable in P2SH evaluationPieter Wuille2014-11-251-7/+10
| |
* | String conversions uint256 -> uint256SWladimir J. van der Laan2015-01-051-1/+1
| | | | | | | | | | | | | | If uint256() constructor takes a string, uint256(0) will become dangerous when uint256 does not take integers anymore (it will go through std::string(const char*) making a NULL string, and the explicit keyword is no help).
* | Replace uint256(1) with static constantWladimir J. van der Laan2015-01-051-2/+3
| | | | | | | | | | | | SignatureHash and its test function SignatureHashOld return uint256(1) as a special error signaling value. Return a local static constant with the same value instead.
* | Added "Core" to copyright headerssandakersmann2014-12-191-1/+1
| | | | | | | | | | Github-Pull: #5494 Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
* | MOVEONLY: core/ -> primitives/Luke Dashjr2014-12-031-1/+1
| |
* | Merge pull request #5227Wladimir J. van der Laan2014-12-011-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 4cdaa95 Resize after succesful result (Pieter Wuille) 9d8604f Header define style cleanups (Pieter Wuille) a53fd41 Deterministic signing (Pieter Wuille) 3060e36 Add the RFC6979 PRNG (Pieter Wuille) a8f5087 Add HMAC-SHA256 (Pieter Wuille) 36fa4a7 Split up crypto/sha2 (Pieter Wuille)
| * | Split up crypto/sha2Pieter Wuille2014-11-201-1/+1
| | |
* | | libbitcoinconsensus: don't require any global constructorsCory Fields2014-11-241-7/+8
| |/ |/| | | | | These static objects are only used in once place, so declare them there instead.
* | Test the exact order of CHECKMULTISIG sig/pubkey evaluationPeter Todd2014-11-201-1/+5
| | | | | | | | Possible with STRICTENC
* | Make STRICTENC invalid pubkeys fail the script rather than the opcode.Pieter Wuille2014-11-201-6/+6
|/ | | | | | | This turns STRICTENC turn into a softforking-safe change (even though it is not intended as a consensus rule), and as a result guarantee that using it for mempool validation only results in consensus-valid transactions in the mempool.
* Discourage NOPs reserved for soft-fork upgradesPeter Todd2014-11-171-0/+6
| | | | | | | | | | | | | | | | | NOP1 to NOP10 are reserved for future soft-fork upgrades. In the event of an upgrade such NOPs have *VERIFY behavior, meaning that if their arguments are not correct the script fails. Discouraging these NOPs by rejecting transactions containing them from the mempool ensures that we'll never accept transactions, nor mine blocks, with scripts that are now invalid according to the majority of hashing power even if we're not yet upgraded. Previously this wasn't an issue as the IsStandard() rules didn't allow upgradable NOPs anyway, but 7f3b4e95 relaxed the IsStandard() rules for P2SH redemptions allowing any redeemScript to be spent. We *do* allow upgradable NOPs in scripts so long as they are not executed. This is harmless as there is no opportunity for the script to be invalid post-upgrade.
* script: create sane error return codes for script validation and remove loggingCory Fields2014-11-141-117/+180
| | | | | | | | | | | Attempt to codify the possible error statuses associated with script validation. script/types.h has been created with the expectation that it will be part of the public lib interface. The other flag enums will be moved here in a future commit. Logging has also been removed in order to drop the dependency on core.h. It can be re-added to bitcoind as-needed. This makes script verification finally free of application state and boost!
* Make comments in /src/script doxygen compatibleMichael Ford2014-11-101-17/+22
|
* boost: moveonly: split CPubKey and friends to new filesCory Fields2014-10-311-1/+1
|
* boost: moveonly: create eccryptoverify.h|cpp and move helper functions thereCory Fields2014-10-311-1/+2
| | | | | Eventually (after 0.10) these files will hold the logic for crypto verification routines, and CKey/CPubKey will call into them.
* Merge pull request #5100Pieter Wuille2014-10-281-1/+1
|\ | | | | | | | | | | | | | | 99f41b9 MOVEONLY: core.o -> core/block.o (jtimon) 561e9e9 MOVEONLY: Move script/compressor out of script and put CTxOutCompressor (from core) with it (jtimon) 999a2ab MOVEONLY: separate CTxUndo out of core (jtimon) 4a3587d MOVEONLY: Separate CTransaction and dependencies from core (jtimon) eda3733 MOVEONLY: Move CFeeRate and Amount constants to amount.o (jtimon)
| * MOVEONLY: Separate CTransaction and dependencies from corejtimon2014-10-271-1/+1
| |
* | Add SCRIPT_VERIFY_MINIMALDATA (BIP62 rules 3 and 4)Pieter Wuille2014-10-251-11/+40
| | | | | | | | | | Also use the new flag as a standard rule, and replace the IsCanonicalPush standardness check with it (as it is more complete).
* | Add SCRIPT_VERIFY_SIGPUSHONLY (BIP62 rule 2)Pieter Wuille2014-10-251-0/+4
|/
* script: add a slew of includes all around and drop includes from script.hCory Fields2014-10-171-0/+1
| | | | Lots of files ended up with indirect includes from script.h.
* Make SCRIPT_VERIFY_STRICTENC compatible with BIP62Pieter Wuille2014-10-081-21/+55
| | | | | | | | * Delete canonical_tests.cpp, and move the tests to script_tests.cpp. * Split off SCRIPT_VERIFY_DERSIG from SCRIPT_VERIFY_STRICTENC (the BIP62 part of it). * Change signature STRICTENC/DERSIG semantics to fail the script entirely rather than the CHECKSIG result (softfork safety, and BIP62 requirement). * Add many autogenerated tests for several odd cases. * Mention specific BIP62 rules in the script verification flags.
* Replace SCRIPT_VERIFY_NOCACHE by flag directly to checkerPieter Wuille2014-10-021-5/+5
|
* Make signature cache optionalPieter Wuille2014-10-021-68/+6
|
* Abstract out SignatureCheckerPieter Wuille2014-10-021-9/+10
|
* script: don't read past the endCory Fields2014-09-251-1/+2
|