aboutsummaryrefslogtreecommitdiff
path: root/src/script
Commit message (Collapse)AuthorAgeFilesLines
* 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
| |
* | Get rid of inaccurate ScriptSigArgsExpectedPieter Wuille2016-02-012-22/+0
| | | | | | | | (cherry picked from commit 52b29dca7670c3f6d2ab918c0fff1d17c4e494ad)
* | Merge pull request #7205Wladimir J. van der Laan2016-01-0512-12/+12
|\ \ | | | | | | | | | | | | | | | 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-1312-12/+12
| |/
* / Rename OP_NOP2 to OP_CHECKLOCKTIMEVERIFY.mb300sd2015-12-152-3/+3
|/
* Merge pull request #6914Wladimir J. van der Laan2015-12-014-11/+15
|\ | | | | | | 114b581 Prevector type (Pieter Wuille)
| * Prevector typePieter Wuille2015-11-134-11/+15
| |
* | [trivial] Reuse translation and cleanup DEFAULT_* valuesMarcoFalke2015-11-282-1/+3
| | | | | | | | | | * DEFAULT_DISABLE_SAFEMODE = false * Use DEFAULT_* constants for extern bools
* | Constrain constant values to a single location in codeLuke Dashjr2015-11-282-0/+2
| |
* | Switch to libsecp256k1-based validation for ECDSAPieter Wuille2015-11-152-12/+10
|/
* Evict sigcache entries that are seen in a blockPieter Wuille2015-10-311-2/+13
|
* Make sigcache faster and more efficientPieter Wuille2015-10-312-34/+50
|
* Merge pull request #6351Wladimir J. van der Laan2015-10-231-3/+4
|\ | | | | | | | | | | 65ef372 Add BIP65 to getblockchaininfo softforks list (Peter Todd) cde7ab2 Add RPC tests for the CHECKLOCKTIMEVERIFY (BIP65) soft-fork (Peter Todd) 287f54f Add CHECKLOCKTIMEVERIFY (BIP65) soft-fork logic (Peter Todd)
| * Add CHECKLOCKTIMEVERIFY (BIP65) soft-fork logicPeter Todd2015-10-081-3/+4
| | | | | | | | | | Based on the earlier BIP66 soft-fork logic implemented by Pieter Wuille's 5a47811da5158df763aa2fca09ce646ee0c51e7b
* | script: Remove magic numbersDavid Hill2015-10-153-5/+12
|/ | | | | 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-014-14/+12
| | | | | | | | | | | | 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-012-2/+7
| | | | | Allows IsPushOnly() to be applied to just part of the script for OP_RETURN outputs.
* Make TX_SCRIPTHASH clear vSolutionsRet firstPeter Todd2015-10-011-0/+2
| | | | | | | Previously unlike other transaction types the TX_SCRIPTHASH would not clear vSolutionsRet, which means that unlike other transaction types if it was called twice in a row you would get the result of the previous invocation as well.
* Merge pull request #5264Wladimir J. van der Laan2015-09-254-35/+3
|\ | | | | | | 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-304-35/+3
| | | | | | | | | | 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.
* | Merge pull request #6544Wladimir J. van der Laan2015-08-191-1/+1
|\ \ | | | | | | | | | | | | c5c1edf Fix spelling mistake in -> if. (Mark Friedenbach) e846b2a Correct a possibly intentional pun that is nevertheless hard to read: "two times of nLockTime." What is meant is that there are two kinds, or categories of nLockTime. (Mark Friedenbach)
| * | 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.
* / Also remove pay-2-pubkey from watch when adding a priv keyMatt Corallo2015-07-202-0/+6
|/
* Separate core memory usage computation in core_memusage.hPieter Wuille2015-07-202-8/+0
|
* Implement accurate memory accounting for mempoolPieter Wuille2015-07-102-0/+8
|
* Merge pull request #6335Wladimir J. van der Laan2015-07-063-39/+2
|\ | | | | | | | | 9238ecb Policy: MOVEONLY: 3 functions to policy.o: (Luke Dashjr) 627b9de Policy: MOVEONLY: Create policy/policy.h with some constants (Jorge Timón)
| * Policy: MOVEONLY: 3 functions to policy.o:Luke Dashjr2015-06-262-21/+0
| | | | | | | | | | | | | | | | - [script/standard.o] IsStandard - [main.o] IsStandardTx - [main.o] AreInputsStandard Also, don't use namespace std in policy.cpp
| * Policy: MOVEONLY: Create policy/policy.h with some constantsJorge Timón2015-06-262-18/+2
| |
* | 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-266-6/+111
|\ | | | | | | | | | | | | 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)
| * Enable CHECKLOCKTIMEVERIFY as a standard script verify flagPeter Todd2015-06-221-1/+2
| | | | | | | | | | | | | | Transactions that fail CLTV verification will be rejected from the mempool, making it easy to test the feature. However blocks containing "invalid" CLTV-using transactions will still be accepted; this is *not* the soft-fork required to actually enable CLTV for production use.
| * Replace NOP2 with CHECKLOCKTIMEVERIFY (BIP65)Peter Todd2015-06-215-2/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <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.
| * Make CScriptNum() take nMaxNumSize as an argumentPeter Todd2015-05-091-3/+4
| | | | | | | | | | While the existing numeric opcodes are all limited to 4-byte bignum arguments, new opcodes will need different limits.
* | Add DummySignatureCreator which just creates zeroed sigsPieter Wuille2015-06-112-0/+44
| |
* | fix header include groupsPhilip Kaufmann2015-05-141-1/+2
|/
* Abstract out Ctransaction-specific signing into TransactionSignatureCreatorPieter Wuille2015-03-212-40/+90
|