aboutsummaryrefslogtreecommitdiff
path: root/src/script.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rename script.h/.cpp to scriptutils.h/.cpp (plus remove duplicated includes)jtimon2014-09-081-2079/+0
|
* Clarify 'compressed nor uncompressed' error messagePeter Todd2014-09-071-1/+1
|
* remove dup include of foreach.hpp in script.cppPhilip Kaufmann2014-09-051-3/+1
|
* Discover some missing includesjtimon2014-09-021-0/+2
|
* Merge pull request #4748Pieter Wuille2014-08-261-1/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | ad49c25 Split up util.cpp/h (Wladimir J. van der Laan) f841aa2 Move `COIN` and `CENT` to core.h (Wladimir J. van der Laan) 6e5fd00 Move `*Version()` functions to version.h/cpp (Wladimir J. van der Laan) b4aa769 Move `S_I*` constants and `MSG_NOSIGNAL` to compat.h (Wladimir J. van der Laan) af8297c Move functions in wallet.h to implementation file (Wladimir J. van der Laan) 651480c move functions in main and net to implementation files (Wladimir J. van der Laan) 610a8c0 Move SetThreadPriority implementation to util.cpp instead of the header (Wladimir J. van der Laan) f780e65 Remove unused function `ByteReverse` from util.h (Wladimir J. van der Laan) 121d6ad Remove unused `alignup` function from util.h (Wladimir J. van der Laan) d1e26d4 Move CMedianFilter to timedata.cpp (Wladimir J. van der Laan)
| * Split up util.cpp/hWladimir J. van der Laan2014-08-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Split up util.cpp/h into: - string utilities (hex, base32, base64): no internal dependencies, no dependency on boost (apart from foreach) - money utilities (parsesmoney, formatmoney) - time utilities (gettime*, sleep, format date): - and the rest (logging, argument parsing, config file parsing) The latter is basically the environment and OS handling, and is stripped of all utility functions, so we may want to rename it to something else than util.cpp/h for clarity (Matt suggested osinterface). Breaks dependency of sha256.cpp on all the things pulled in by util.
* | Test IsPushOnly() with invalid pushPeter Todd2014-08-241-0/+2
|/
* Remove unused CKeyStoreIsMineVisitorjtimon2014-08-121-12/+0
|
* move rand functions from util to new random.h/.cppPhilip Kaufmann2014-07-091-4/+4
|
* replaced MINE_ with ISMINE_JaSK2014-07-021-8/+8
|
* Use script matching rather than destination matching for watch-only.Pieter Wuille2014-07-021-15/+7
| | | | | | | | | | | | | | | | | | | This changes the keystore data format, wallet format and IsMine logic to detect watch-only outputs based on direct script matching rather than first trying to convert outputs to destinations (addresses). The reason is that we don't know how the software that has the spending keys works. It may support the same types of scripts as us, but that is not guaranteed. Furthermore, it removes the ambiguity between addresses used as identifiers for output scripts or identifiers for public keys. One practical implication is that adding a normal pay-to-pubkey-hash address via importaddress will not cause payments to the corresponding full public key to be detected as IsMine. If that is wanted, add those scripts directly (importaddress now also accepts any hex-encoded script). Conflicts: src/wallet.cpp
* Add support for watch-only addressesPieter Wuille2014-07-021-13/+39
| | | | | | | | | | | | | | | | | | | | | | Changes: * Add Add/Have WatchOnly methods to CKeyStore, and implementations in CBasicKeyStore. * Add similar methods to CWallet, and support entries for it in CWalletDB. * Make IsMine in script/wallet return a new enum 'isminetype', rather than a boolean. This allows distinguishing between spendable and unspendable coins. * Add a field fSpendable to COutput (GetAvailableCoins' return type). * Mark watchonly coins in listunspent as 'watchonly': true. * Add 'watchonly' to validateaddress, suppressing script/pubkey/... in this case. Based on a patch by Eric Lombrozo. Conflicts: src/qt/walletmodel.cpp src/rpcserver.cpp src/wallet.cpp
* Merge pull request #4398Wladimir J. van der Laan2014-06-281-2/+3
|\ | | | | | | | | 86fe1b8 update coding.md to reflect changes by pull (Philip Kaufmann) e10dcf2 ensure clean and consistent "namespace" usage (Philip Kaufmann)
| * ensure clean and consistent "namespace" usagePhilip Kaufmann2014-06-261-2/+3
| | | | | | | | | | | | - remove some missplaced ; - ensure end of a namespace is clearly visible - use same formatting when using namespace
* | Add an option to allow users to disable relaying/mining data carrier ↵Luke Dashjr2014-06-261-1/+2
|/ | | | transactions
* Add CMutableTransaction and make CTransaction immutable.Pieter Wuille2014-06-211-3/+3
| | | | | In addition, introduce a cached hash inside CTransaction, to prevent recalculating it over and over again.
* Add built-in RIPEMD-160 implementationPieter Wuille2014-06-211-1/+2
|
* Move crypto implementations to src/crypto/Pieter Wuille2014-06-211-2/+2
|
* Add built-in SHA-1 implementation.Pieter Wuille2014-06-211-3/+2
|
* Switch script.cpp and hash.cpp to use sha2.cpp instead of OpenSSL.Pieter Wuille2014-06-211-9/+6
|
* Remove unused Print/PrintHex functionsWladimir J. van der Laan2014-06-101-4/+0
| | | | | You can just use HexStr(script) or script.ToString() for debugging, no need for these extra functions.
* Remove template matching params from GetOpName()Huang Le2014-05-311-6/+5
| | | | | | Since they are not real opcodes, being reported as OP_UNKNOWN is less confusing for human-readable decoding. Signed-off-by: Huang Le <[email protected]>
* Merge pull request #3637Wladimir J. van der Laan2014-05-091-3/+6
|\ | | | | | | 6fd7ef2 Also switch the (unused) verification code to low-s instead of even-s. (Pieter Wuille)
| * Also switch the (unused) verification code to low-s instead of even-s.Pieter Wuille2014-03-101-3/+6
| | | | | | | | | | | | | | | | a81cd968 introduced a malleability breaker for signatures (using an even value for S). In e0e14e43 this was changed to the lower of two potential values, rather than the even one. Only the signing code was changed though, the (for now unused) verification code wasn't adapted.
* | Merge pull request #3843Wladimir J. van der Laan2014-05-091-2/+16
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 787ee0c Check redeemScript size does not exceed 520 byte limit (Peter Todd) 4d79098 Increase IsStandard() scriptSig length (Peter Todd) f80cffa Do not trigger a DoS ban if SCRIPT_VERIFY_NULLDUMMY fails (Peter Todd) 6380180 Add rejection of non-null CHECKMULTISIG dummy values (Peter Todd) 29c1749 Let tx (in)valid tests use any SCRIPT_VERIFY flag (Peter Todd) 68f7d1d Create (MANDATORY|STANDARD)_SCRIPT_VERIFY_FLAGS constants (Peter Todd)
| * | Add rejection of non-null CHECKMULTISIG dummy valuesPeter Todd2014-05-081-1/+15
| | | | | | | | | | | | | | | | | | This is a source of transaction mutability as the dummy value was previously not checked and could be modified to something other than the usual OP_0 value.
| * | Create (MANDATORY|STANDARD)_SCRIPT_VERIFY_FLAGS constantsPeter Todd2014-05-051-1/+1
| |/
* | script: remove bignum dependencyCory Fields2014-04-221-1/+0
| |
* | script: switch to CScriptNum usage for scriptsCory Fields2014-04-221-27/+17
|/
* script: reduce OP_RETURN standard relay bytes to 40Jeff Garzik2014-02-261-2/+2
| | | | Per mailing list discussion.
* script: tighten multisig non-standard rules: do not relay pubkeys above 65 bytesJeff Garzik2014-02-211-2/+2
|
* Add HasCanonicalPushes(), and use it in IsStandardTxPieter Wuille2014-02-111-0/+27
|
* Move IsPushOnly() to script.cppPieter Wuille2014-02-111-0/+18
|
* Merge pull request #3257Wladimir J. van der Laan2013-11-201-2/+0
|\ | | | | | | 379778b core: remove includes in .cpp, if header is already in .h (Philip Kaufmann)
| * core: remove includes in .cpp, if header is already in .hPhilip Kaufmann2013-11-151-2/+0
| | | | | | | | | | - example: if util.h includes stdint.h, remove it from util.cpp, as util.h is the first header included in util.cpp
* | orphan spaces cleanup ;-)Philip Kaufmann2013-11-151-1/+1
|/
* Cleanup code using forward declarations.Brandon Dahler2013-11-101-8/+12
| | | | | | | | | Use misc methods of avoiding unnecesary header includes. Replace int typedefs with int##_t from stdint.h. Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h. Normalize QT_VERSION ifs where possible. Resolve some indirect dependencies as direct ones. Remove extern declarations from .cpp files.
* Relay OP_RETURN TxOut as standard transaction typePeter Todd2013-10-241-5/+7
| | | | | | Also fix decoderawtransaction to not show reqSigs or addresses for nulldata txouts. (Previous version also left reqSigs uninitialized mistakenly)
* Merge pull request #2738 from jgarzik/op_returnGavin Andresen2013-10-211-2/+19
|\ | | | | Relay OP_RETURN data TxOut as standard transaction type.
| * Relay OP_RETURN data TxOut as standard transaction typeJeff Garzik2013-10-021-2/+19
| |
* | Merge pull request #3119Pieter Wuille2013-10-201-1/+1
|\ \ | | | | | | | | | db0e8cc Bump Year Number to 2013 (super3)
| * | Bump Year Number to 2013super32013-10-201-1/+1
| |/
* / Inline signature serializerPieter Wuille2013-09-281-45/+101
|/ | | | | | | | | | | | | | | | Instead of building a full copy of a CTransaction being signed, and then modifying bits and pieces until its fits the form necessary for computing the signature hash, use a wrapper serializer that only serializes the necessary bits on-the-fly. This makes it easier to see which data is actually being hash, reduces load on the heap, and also marginally improves performances (around 3-4us/sigcheck here). The performance improvements are much larger for large transactions, though. The old implementation of SignatureHash is moved to a unit tests, to test whether the old and new algorithm result in the same value for randomly-constructed transactions.
* Replace printf with LogPrintf / LogPrintGavin Andresen2013-09-181-2/+2
|
* Merge pull request #2938 from petertodd/op-reserved-weirdnessGavin Andresen2013-08-251-0/+2
|\ | | | | Document and test OP_RESERVED weirdness
| * Document and test OP_RESERVED weirdnessPeter Todd2013-08-251-0/+2
| | | | | | | | | | | | Seems it was forgotten about when IsPushOnly() and the unittests were written. A particular oddity is that OP_RESERVED doesn't count towards the >201 opcode limit unlike every other named opcode.
* | Merge pull request #2618 from fcicq/solaris-supportJeff Garzik2013-08-241-6/+6
|\ \ | |/ |/| Partial solaris support
| * Fix boost uint type bug by reordering the includesfcicq2013-07-171-6/+6
| |
* | Only create signatures with even S, and verification mode to check.Pieter Wuille2013-08-161-9/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To fix a minor malleability found by Sergio Lerner (reported here: https://bitcointalk.org/index.php?topic=8392.msg1245898#msg1245898) The problem is that if (R,S) is a valid ECDSA signature for a given message and public key, (R,-S) is also valid. Modulo N (the order of the secp256k1 curve), this means that both (R,S) and (R,N-S) are valid. Given that N is odd, S and N-S have a different lowest bit. We solve the problem by forcing signatures to have an even S value, excluding one of the alternatives. This commit just changes the signing code to always produce even S values, and adds a verification mode to check it. This code is not enabled anywhere yet. Existing tests in key_tests.cpp verify that the produced signatures are still valid.
* | Remove #define loop from util.hGavin Andresen2013-07-311-1/+1
|/ | | | | Replace the loop macro with while (true). The #define caused problems for Qt.