aboutsummaryrefslogtreecommitdiff
path: root/src/script
AgeCommit message (Collapse)Author
2015-12-01Merge pull request #6914Wladimir J. van der Laan
114b581 Prevector type (Pieter Wuille)
2015-11-28[trivial] Reuse translation and cleanup DEFAULT_* valuesMarcoFalke
* DEFAULT_DISABLE_SAFEMODE = false * Use DEFAULT_* constants for extern bools
2015-11-28Constrain constant values to a single location in codeLuke Dashjr
2015-11-15Switch to libsecp256k1-based validation for ECDSAPieter Wuille
2015-11-13Prevector typePieter Wuille
2015-10-31Evict sigcache entries that are seen in a blockPieter Wuille
2015-10-31Make sigcache faster and more efficientPieter Wuille
2015-10-23Merge pull request #6351Wladimir J. van der Laan
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)
2015-10-15script: Remove magic numbersDavid Hill
This adds two new constants, MAX_OPS_PER_SCRIPT and MAX_PUBKEYS_PER_MULTISIG.
2015-10-08Add CHECKLOCKTIMEVERIFY (BIP65) soft-fork logicPeter Todd
Based on the earlier BIP66 soft-fork logic implemented by Pieter Wuille's 5a47811da5158df763aa2fca09ce646ee0c51e7b
2015-10-01Accept any sequence of PUSHDATAs in OP_RETURN outputsPeter Todd
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!)
2015-10-01Add IsPushOnly(const_iterator pc)Peter Todd
Allows IsPushOnly() to be applied to just part of the script for OP_RETURN outputs.
2015-10-01Make TX_SCRIPTHASH clear vSolutionsRet firstPeter Todd
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.
2015-09-25Merge pull request #5264Wladimir J. van der Laan
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)
2015-08-19Merge pull request #6544Wladimir J. van der Laan
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)
2015-08-10Correct a possibly intentional pun that is nevertheless hard to read: "two ↵Mark Friedenbach
times of nLockTime." What is meant is that there are two kinds, or categories of nLockTime.
2015-07-30Resolve issue 3166.mruddy
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.
2015-07-20Also remove pay-2-pubkey from watch when adding a priv keyMatt Corallo
2015-07-20Separate core memory usage computation in core_memusage.hPieter Wuille
2015-07-10Implement accurate memory accounting for mempoolPieter Wuille
2015-07-06Merge pull request #6335Wladimir J. van der Laan
9238ecb Policy: MOVEONLY: 3 functions to policy.o: (Luke Dashjr) 627b9de Policy: MOVEONLY: Create policy/policy.h with some constants (Jorge Timón)
2015-07-01add CReserveScript to allow modular script keeping/returningJonas Schnelli
- use one CReserveScript per mining thread
2015-06-26Policy: MOVEONLY: 3 functions to policy.o:Luke Dashjr
- [script/standard.o] IsStandard - [main.o] IsStandardTx - [main.o] AreInputsStandard Also, don't use namespace std in policy.cpp
2015-06-26Policy: MOVEONLY: Create policy/policy.h with some constantsJorge Timón
2015-06-26Merge pull request #6124Wladimir J. van der Laan
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)
2015-06-22Enable CHECKLOCKTIMEVERIFY as a standard script verify flagPeter Todd
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.
2015-06-21Replace NOP2 with CHECKLOCKTIMEVERIFY (BIP65)Peter Todd
<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.
2015-06-11Add DummySignatureCreator which just creates zeroed sigsPieter Wuille
2015-05-14fix header include groupsPhilip Kaufmann
2015-05-09Move LOCKTIME_THRESHOLD to src/script/script.hPeter Todd
Will now be needed by CHECKLOCKTIMEVERIFY code.
2015-05-09Make CScriptNum() take nMaxNumSize as an argumentPeter Todd
While the existing numeric opcodes are all limited to 4-byte bignum arguments, new opcodes will need different limits.
2015-03-21Abstract out Ctransaction-specific signing into TransactionSignatureCreatorPieter Wuille
2015-03-06src/script/script.h: endian compatibility for PUSHDATA sizesWladimir J. van der Laan
2015-02-03Merge pull request #5286Wladimir J. van der Laan
44e9a6b Update the 'test_IsStandard' unit test (Flavien Charlon) a930658 Change the default maximum OP_RETURN size to 80 bytes (Flavien Charlon)
2015-02-03Merge pull request #5713Wladimir J. van der Laan
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)
2015-02-02Avoid storing a reference passed to SignatureChecker constructorsPieter Wuille
2015-02-02Use separate SignatureChecker for CMutableTransactionPieter Wuille
2015-02-01BIP66 changeover logicPieter Wuille
2015-02-01Change IsDERSignature to BIP66 implementationPieter Wuille
2015-01-31Remove whitespaces before double colon in errors and logsPavel Janík
2015-01-09Make empty byte arrays pass CheckSignatureEncoding()Peter Todd
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.
2015-01-08Merge pull request #5143Wladimir J. van der Laan
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)
2015-01-05String conversions uint256 -> uint256SWladimir J. van der Laan
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).
2015-01-05Replace uint256(1) with static constantWladimir J. van der Laan
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.
2015-01-05Replace direct use of 0 with SetNull and IsNullWladimir J. van der Laan
Replace x=0 with .SetNull(), x==0 with IsNull(), x!=0 with !IsNull(). Replace uses of uint256(0) with uint256().
2014-12-25Fix CScriptID(const CScript& in) in empty script casePeter Todd
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" }
2014-12-19Added "Core" to copyright headerssandakersmann
Github-Pull: #5494 Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
2014-12-17make all catch() arguments constPhilip Kaufmann
- 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
2014-12-05Normalize header guard of script_error.hPavel Janík
2014-12-03MOVEONLY: core/ -> primitives/Luke Dashjr