aboutsummaryrefslogtreecommitdiff
path: root/src/script
Commit message (Collapse)AuthorAgeFilesLines
...
* | | 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)
| * boost: moveonly: split CPubKey and friends to new filesCory Fields2014-10-314-4/+5
| |
| * 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 #5077Wladimir J. van der Laan2014-10-312-2/+5
|\ \ | |/ |/| | | 2aa6329 Enable customising node policy for datacarrier data size with a -datacarriersize option (Luke Dashjr)
| * Enable customising node policy for datacarrier data size with a ↵Luke Dashjr2014-10-272-2/+5
| | | | | | | | -datacarriersize option
* | Merge pull request #5100Pieter Wuille2014-10-284-221/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | 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: Move script/compressor out of script and put CTxOutCompressor (fromjtimon2014-10-272-219/+0
| | | | | | | | | | | | core) with it
| * | MOVEONLY: Separate CTransaction and dependencies from corejtimon2014-10-272-2/+2
| |/
* | Improve CScriptNum() commentPeter Todd2014-10-251-2/+17
| | | | | | | | Edited-by: Pieter Wuille <[email protected]>
* | Add SCRIPT_VERIFY_MINIMALDATA (BIP62 rules 3 and 4)Pieter Wuille2014-10-255-46/+60
| | | | | | | | | | 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-254-2/+9
|/
* fix build with libc++ after 85c579eCory Fields2014-10-231-0/+1
|
* script: add a slew of includes all around and drop includes from script.hCory Fields2014-10-177-7/+18
| | | | Lots of files ended up with indirect includes from script.h.
* script: move ToString and ValueString out of the headerCory Fields2014-10-172-29/+34
|
* script: add ToByteVector() for converting anything with begin/endCory Fields2014-10-173-27/+10
| | | | This should move to a util header once their dependencies are cleaned up.
* script: move CScriptID to standard.h and add a ctor for creating them from ↵Cory Fields2014-10-175-6/+14
| | | | | | | | | | | | | | | | CScripts This allows for a reversal of the current behavior. This: CScript foo; CScriptID bar(foo.GetID()); Becomes: CScript foo; CScriptID bar(foo); This way, CScript is no longer dependent on CScriptID or Hash();
* Make SCRIPT_VERIFY_STRICTENC compatible with BIP62Pieter Wuille2014-10-082-28/+73
| | | | | | | | * 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.
* Merge pull request #4954Wladimir J. van der Laan2014-10-071-2/+13
|\ | | | | | | 9d7cd4c Don't return an address for invalid pubkeys (Andy Alness)
| * Don't return an address for invalid pubkeysAndy Alness2014-10-061-2/+13
| |
* | minor license, header end comment etc. cleanup in /scriptPhilip Kaufmann2014-10-063-6/+6
| | | | | | | | | | | | - ensure all licenses are just MIT - add a missing header end comment - ensure alphabetical ordering
* | Replace SCRIPT_VERIFY_NOCACHE by flag directly to checkerPieter Wuille2014-10-025-27/+18
| |
* | Make signature cache optionalPieter Wuille2014-10-025-86/+150
| |
* | Abstract out SignatureCheckerPieter Wuille2014-10-023-13/+36
| |
* | script: don't read past the endCory Fields2014-09-251-1/+2
| |
* | Merge pull request #4969Wladimir J. van der Laan2014-09-251-1/+1
|\ \ | | | | | | | | | cda45b5 Reinitializing list's begin iterator after few elements were erased from the head (ENikS)
| * | Reinitializing list's begin iterator after few elements were erased from the ↵ENikS2014-09-231-1/+1
| | | | | | | | | | | | head
* | | Fixing C4146 warningENikS2014-09-251-1/+1
| | | | | | | | | | | | Rebased-By: Wladimir J. van der Laan <[email protected]>
* | | script: Fix reference into empty vector run time exceptionENikS2014-09-251-6/+6
|/ / | | | | | | Edit by laanwj: `begin_ptr(sourcedata) + sourcedata.size()` -> `end_ptr(sourcedata)`