aboutsummaryrefslogtreecommitdiff
path: root/src/script
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* src/script/script.h: endian compatibility for PUSHDATA sizesWladimir J. van der Laan2015-03-061-7/+9
|
* Merge pull request #5286Wladimir J. van der Laan2015-02-031-1/+1
|\ | | | | | | | | 44e9a6b Update the 'test_IsStandard' unit test (Flavien Charlon) a930658 Change the default maximum OP_RETURN size to 80 bytes (Flavien Charlon)
| * Change the default maximum OP_RETURN size to 80 bytesFlavien Charlon2014-11-141-1/+1
| | | | | | | | | | The value can be changed through the '-datacarriersize' option, this is modifying the default value for that option.
* | Merge pull request #5713Wladimir J. van der Laan2015-02-033-63/+65
|\ \ | | | | | | | | | | | | | | | | | | | | | 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)
| * | BIP66 changeover logicPieter Wuille2015-02-012-0/+2
| | |
| * | Change IsDERSignature to BIP66 implementationPieter Wuille2015-02-011-63/+63
| | |
* | | Avoid storing a reference passed to SignatureChecker constructorsPieter Wuille2015-02-025-8/+8
| | |
* | | Use separate SignatureChecker for CMutableTransactionPieter Wuille2015-02-026-11/+21
| | |
* | | Remove whitespaces before double colon in errors and logsPavel Janík2015-01-312-2/+2
|/ /
* | 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-084-13/+33
|\ \ | | | | | | | | | | | | | | | 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)
| * | Make SCRIPT_VERIFY_CLEANSTACK a standardness requirementPieter Wuille2014-11-251-1/+2
| | |
| * | Add SCRIPT_VERIFY_CLEANSTACK (BIP62 rule 6)Pieter Wuille2014-11-253-5/+21
| | | | | | | | | | | | | | | 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.
* | | Replace direct use of 0 with SetNull and IsNullWladimir J. van der Laan2015-01-051-1/+1
| | | | | | | | | | | | | | | | | | Replace x=0 with .SetNull(), x==0 with IsNull(), x!=0 with !IsNull(). Replace uses of uint256(0) with uint256().
* | | Fix CScriptID(const CScript& in) in empty script casePeter Todd2014-12-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously an empty script wouldn't be hashed, and CScriptID would be assigned the incorrect value of 0 instead. This bug can be seen in the RPC decodescript command: $ btc decodescript "" { "asm" : "", "type" : "nonstandard", "p2sh" : "31h1vYVSYuKP6AhS86fbRdMw9XHieotbST" } Correct output: $ btc decodescript "" { "asm" : "", "type" : "nonstandard", "p2sh" : "3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy" }
* | | Added "Core" to copyright headerssandakersmann2014-12-1914-14/+14
| | | | | | | | | | | | | | | Github-Pull: #5494 Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
* | | make all catch() arguments constPhilip Kaufmann2014-12-171-1/+1
| | | | | | | | | | | | | | | | | | | | | - I saw this on http://en.cppreference.com/w/cpp/language/try_catch and thought it would be a good idea - also unify used format to better be able to search for exception uses in our codebase
* | | Normalize header guard of script_error.hPavel Janík2014-12-051-3/+3
| | |
* | | MOVEONLY: core/ -> primitives/Luke Dashjr2014-12-033-3/+3
| | |
* | | 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-204-8/+11
|/ / | | | | | | | | | | | | 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.
* | Merge pull request #5000Pieter Wuille2014-11-205-2/+25
|\ \ | | | | | | | | | 0391423 Discourage NOPs reserved for soft-fork upgrades (Peter Todd)
| * | Discourage NOPs reserved for soft-fork upgradesPeter Todd2014-11-175-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | build: add libbitcoinconsensus files and hook up the lib buildCory Fields2014-11-192-0/+158
|/ / | | | | | | Credit BlueMatt for libbitcoinsonsensus.h/cpp
* / script: create sane error return codes for script validation and remove loggingCory Fields2014-11-144-119/+304
|/ | | | | | | | | | | 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-107-63/+85
|
* Avoid a bunch of copying/conversion in script/signPieter Wuille2014-11-042-5/+5
|
* minor code style cleanup after recent mergesPhilip Kaufmann2014-11-041-2/+2
| | | | | - add a missing license header - correct some header orderings etc.
* Merge pull request #5196Wladimir J. van der Laan2014-11-045-15/+15
|\ | | | | | | 8473862 Fix all header defines (Pavel Janík)
| * Fix all header definesPavel Janík2014-11-035-15/+15
| |
* | Merge pull request #5162Wladimir J. van der Laan2014-11-044-5/+7
|\ \ | |/ |/| | | | | | | d2e74c5 boost: moveonly: split CPubKey and friends to new files (Cory Fields) 78c228c boost: moveonly: move BIP32Hash to hash.h (Cory Fields) 900078a boost: moveonly: create eccryptoverify.h|cpp and move helper functions there (Cory Fields)