aboutsummaryrefslogtreecommitdiff
path: root/src/primitives
Commit message (Collapse)AuthorAgeFilesLines
* crypto: Add scrypt N=1024 PoWbarrystyle2021-05-301-1/+1
| | | | | Add scrypt pow hashing algorithm as a proof of work function. Rebased from litecoin-project/litecoin@02961f0 minus strencodings.h macros.
* Litecoin: Add scrypt N=1024 PoWshaolinfry2021-05-302-0/+11
|
* Report and verify expirationsPieter Wuille2020-10-121-2/+2
|
* net: CNetAddr: add support to (un)serialize as ADDRv2Vasil Dimov2020-09-171-0/+6
| | | | Co-authored-by: Carl Dong <[email protected]>
* refactor: add GenTxid (=txid or wtxid) type and use it for tx request logicPieter Wuille2020-07-301-0/+15
|
* Merge #18317: Serialization improvements step 6 (all except wallet/gui)MarcoFalke2020-05-202-44/+11
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | f9ee0f37c28f604bc82dab502ce229c66ef5b3b9 Add comments to CustomUintFormatter (Pieter Wuille) 4eb5643e3538863c9d2ff261f49a9a1b248de243 Convert everything except wallet/qt to new serialization (Pieter Wuille) 2b1f85e8c52c8bc5a17eae4c809eaf61d724af98 Convert blockencodings_tests to new serialization (Pieter Wuille) 73747afbbeb013669faf4c4d2c0903cec4526fb0 Convert merkleblock to new serialization (Pieter Wuille) d06fedd1bc26bf5bf2b203d4445aeaebccca780e Add SER_READ and SER_WRITE for read/write-dependent statements (Russell Yanofsky) 6f9a1e5ad0a270d3b5a715f3e3ea0911193bf244 Extend CustomUintFormatter to support enums (Russell Yanofsky) 769ee5fa0011ae658770586442715452a656559d Merge BigEndian functionality into CustomUintFormatter (Pieter Wuille) Pull request description: The next step of changes from #10785. This: * Adds support for enum serialization to `CustomUintFormatter`, used in `CAddress` for service flags. * Merges `BigEndian` into `CustomUintFormatter`, used in `CNetAddr` for port numbers. * Converts everything (except wallet and gui) to use the new serialization framework. ACKs for top commit: MarcoFalke: re-ACK f9ee0f37c2, only change is new documentation commit for CustomUintFormatter 📂 ryanofsky: Code review ACK f9ee0f37c28f604bc82dab502ce229c66ef5b3b9. Just new commit adding comment since last review jonatack: Code review re-ACK f9ee0f37c28f604bc82dab502ce229c6 only change since last review is an additional commit adding Doxygen documentation for `CustomUintFormatter`. Tree-SHA512: e7a0a36afae592d5a4ff8c81ae04d858ac409388e361f2bc197d9a78abca45134218497ab2dfd6d031e0cce0ca586cf857077b7c6ce17fccf67e2d367c1b6cd4
| * Convert everything except wallet/qt to new serializationPieter Wuille2020-03-302-44/+11
| |
* | Remove CCoinsViewCache::GetValueIn(...)practicalswift2020-05-031-2/+0
| |
* | scripted-diff: Bump copyright headersMarcoFalke2020-04-161-1/+1
| | | | | | | | | | | | -BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
* | Check for overflow when calculating sum of outputsElichai Turkel2020-03-231-2/+5
|/
* scripted-diff: Bump copyright of files changed in 2019MarcoFalke2019-12-302-2/+2
| | | | | | -BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
* Remove unused includespracticalswift2019-10-151-1/+0
|
* Make reasoning about dependencies easier by not including unused dependenciespracticalswift2019-06-021-1/+0
|
* Merge #14039: Disallow extended encoding for non-witness transactionsMarcoFalke2019-04-251-0/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bb530efa18 Disallow extended encoding for non-witness transactions (Pieter Wuille) Pull request description: BIP144 specifies that transactions without witness should use the legacy encoding, which is currently not enforced. This rule was present in the original SegWit implementation (https://github.com/bitcoin/bitcoin/pull/8149), but was subsequently dropped (https://github.com/bitcoin/bitcoin/pull/8589). As all hashes, txids, and weights are always computed over a reserialized version of a transaction, it is mostly harmless to permit extended encoding for non-segwit transactions, but I'd rather strictly follow the BIP. ACKs for commit bb530e: instagibbs: utACK https://github.com/bitcoin/bitcoin/pull/14039/commits/bb530efa1872ec963417f61da9a95185c7a7a7d6 stevenroose: utACK bb530efa1872ec963417f61da9a95185c7a7a7d6 Tree-SHA512: 1aeccd6a555f43784fefb076ce2e8ad2f5ba7be49840544a50050d0390f82373f87201bf56cf8bb30841b4f9cd893b382261a080da875d4e11ab7051f8640dbe
| * Disallow extended encoding for non-witness transactionsPieter Wuille2018-08-231-0/+4
| |
* | Made expicit constructor CTransaction(const CMutableTransaction &tx).lucash-dev2018-12-171-1/+1
| | | | | | | | This makes the above constructor explicit. The rationale is that this conversion has very significant performance effects. Making it explicit makes it easier to reason about these performance trade-offs, and helps identify possible functions that need a CMutableTransaction version.
* | Use const in COutPoint classHennadii Stepanov2018-11-301-3/+5
| |
* | scripted-diff: Move util files to separate directory.Jim Posen2018-11-042-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -BEGIN VERIFY SCRIPT- mkdir -p src/util git mv src/util.h src/util/system.h git mv src/util.cpp src/util/system.cpp git mv src/utilmemory.h src/util/memory.h git mv src/utilmoneystr.h src/util/moneystr.h git mv src/utilmoneystr.cpp src/util/moneystr.cpp git mv src/utilstrencodings.h src/util/strencodings.h git mv src/utilstrencodings.cpp src/util/strencodings.cpp git mv src/utiltime.h src/util/time.h git mv src/utiltime.cpp src/util/time.cpp sed -i 's/<util\.h>/<util\/system\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/<utilmemory\.h>/<util\/memory\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/<utilmoneystr\.h>/<util\/moneystr\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/<utilstrencodings\.h>/<util\/strencodings\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/<utiltime\.h>/<util\/time\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/BITCOIN_UTIL_H/BITCOIN_UTIL_SYSTEM_H/g' src/util/system.h sed -i 's/BITCOIN_UTILMEMORY_H/BITCOIN_UTIL_MEMORY_H/g' src/util/memory.h sed -i 's/BITCOIN_UTILMONEYSTR_H/BITCOIN_UTIL_MONEYSTR_H/g' src/util/moneystr.h sed -i 's/BITCOIN_UTILSTRENCODINGS_H/BITCOIN_UTIL_STRENCODINGS_H/g' src/util/strencodings.h sed -i 's/BITCOIN_UTILTIME_H/BITCOIN_UTIL_TIME_H/g' src/util/time.h sed -i 's/ util\.\(h\|cpp\)/ util\/system\.\1/g' src/Makefile.am sed -i 's/utilmemory\.\(h\|cpp\)/util\/memory\.\1/g' src/Makefile.am sed -i 's/utilmoneystr\.\(h\|cpp\)/util\/moneystr\.\1/g' src/Makefile.am sed -i 's/utilstrencodings\.\(h\|cpp\)/util\/strencodings\.\1/g' src/Makefile.am sed -i 's/utiltime\.\(h\|cpp\)/util\/time\.\1/g' src/Makefile.am sed -i 's/-> util ->/-> util\/system ->/' test/lint/lint-circular-dependencies.sh sed -i 's/src\/util\.cpp/src\/util\/system\.cpp/g' test/lint/lint-format-strings.py test/lint/lint-locale-dependence.sh sed -i 's/src\/utilmoneystr\.cpp/src\/util\/moneystr\.cpp/g' test/lint/lint-locale-dependence.sh sed -i 's/src\/utilstrencodings\.\(h\|cpp\)/src\/util\/strencodings\.\1/g' test/lint/lint-locale-dependence.sh sed -i 's/src\\utilstrencodings\.cpp/src\\util\\strencodings\.cpp/' build_msvc/libbitcoinconsensus/libbitcoinconsensus.vcxproj -END VERIFY SCRIPT-
* | Avoid 1 << 31 (UB) in calculation of SEQUENCE_LOCKTIME_DISABLE_FLAGpracticalswift2018-10-181-1/+1
| |
* | doxygen: Fix member commentsMarcoFalke2018-09-261-1/+1
| |
* | Drop unused GetType() from CSizeComputerBen Woosley2018-09-111-1/+1
|/
* Update copyright headers to 2018DrahtBot2018-07-274-4/+4
|
* Removed unused == operator from CMutableTransaction.[email protected]2018-06-101-5/+0
|
* Cache witness hash in CTransactionMarcoFalke2018-05-042-11/+9
|
* Make CMutableTransaction constructor explicitMarcoFalke2018-05-041-1/+1
| | | | | Silently converting to a CMutableTransaction will drop all caches and should thus be done explicitly
* Support serialization as another type without castingPieter Wuille2018-03-201-1/+1
| | | | | | | | | This adds a READWRITEAS(type, obj) macro which serializes obj as if it were casted to (const type&) when const, and to (type&) when non-const. This makes it usable in serialization code that uses a single implementation for both serialization and deserializing, which doesn't know the constness of the object involved.
* Merge #10498: Use static_cast instead of C-style casts for non-fundamental typesMarcoFalke2018-02-071-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9ad6746ccd Use static_cast instead of C-style casts for non-fundamental types (practicalswift) Pull request description: A C-style cast is equivalent to try casting in the following order: 1. `const_cast(...)` 2. `static_cast(...)` 3. `const_cast(static_cast(...))` 4. `reinterpret_cast(...)` 5. `const_cast(reinterpret_cast(...))` By using `static_cast<T>(...)` explicitly we avoid the possibility of an unintentional and dangerous `reinterpret_cast`. Furthermore `static_cast<T>(...)` allows for easier grepping of casts. For a more thorough discussion, see ["ES.49: If you must use a cast, use a named cast"](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es49-if-you-must-use-a-cast-use-a-named-cast) in the C++ Core Guidelines (Stroustrup & Sutter). Tree-SHA512: bd6349b7ea157da93a47b8cf238932af5dff84731374ccfd69b9f732fabdad1f9b1cdfca67497040f14eaa85346391404f4c0495e22c467f26ca883cd2de4d3c
| * Use static_cast instead of C-style casts for non-fundamental typespracticalswift2017-09-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A C-style cast is equivalent to try casting in the following order: 1. const_cast(...) 2. static_cast(...) 3. const_cast(static_cast(...)) 4. reinterpret_cast(...) 5. const_cast(reinterpret_cast(...)) By using static_cast<T>(...) explicitly we avoid the possibility of an unintentional and dangerous reinterpret_cast. Furthermore static_cast<T>(...) allows for easier grepping of casts.
* | Increment MIT Licence copyright header year on files modified in 2017Akira Takizawa2018-01-034-4/+4
| |
* | scripted-diff: Replace #include "" with #include <> (ryanofsky)MeshCollider2017-11-164-16/+16
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -BEGIN VERIFY SCRIPT- for f in \ src/*.cpp \ src/*.h \ src/bench/*.cpp \ src/bench/*.h \ src/compat/*.cpp \ src/compat/*.h \ src/consensus/*.cpp \ src/consensus/*.h \ src/crypto/*.cpp \ src/crypto/*.h \ src/crypto/ctaes/*.h \ src/policy/*.cpp \ src/policy/*.h \ src/primitives/*.cpp \ src/primitives/*.h \ src/qt/*.cpp \ src/qt/*.h \ src/qt/test/*.cpp \ src/qt/test/*.h \ src/rpc/*.cpp \ src/rpc/*.h \ src/script/*.cpp \ src/script/*.h \ src/support/*.cpp \ src/support/*.h \ src/support/allocators/*.h \ src/test/*.cpp \ src/test/*.h \ src/wallet/*.cpp \ src/wallet/*.h \ src/wallet/test/*.cpp \ src/wallet/test/*.h \ src/zmq/*.cpp \ src/zmq/*.h do base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f done -END VERIFY SCRIPT-
* Merge #8330: Structure Packing Optimizations in C{,Mutable}TransactionWladimir J. van der Laan2017-09-062-6/+6
|\ | | | | | | | | | | | | | | | | | | | | | | 37495e0d8 Reorder C{,Mutable}Transaction for better packing (Jeremy Rubin) Pull request description: These commits revise the layout of a few key classes to eliminate padding, eliminating useless memory overhead. -This reduces CTransaction from 96 bytes to 88 bytes Tree-SHA512: 91d1fec363edebbb1f1a5b98142c767511e99d3be857148a76e31cc512c9ab3d153083fa6b46b6407974d3b88de984b436c33e8606fbb2b273d74c825195aa17
| * Reorder C{,Mutable}Transaction for better packingJeremy Rubin2017-07-122-6/+6
| |
* | Declare single-argument (non-converting) constructors "explicit"practicalswift2017-08-161-1/+1
| | | | | | | | In order to avoid unintended implicit conversions.
* | Replace traditional for with ranged for in primitivesDag Robole2017-07-242-13/+11
| |
* | Merge #10760: Avoid dereference-of-casted-pointerPieter Wuille2017-07-151-2/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 0aadc11fd Avoid dereference-of-casted-pointer (Pieter Wuille) Pull request description: And prefer a static_cast to the intended reference type. Tree-SHA512: e83b20023a4dca6029b46f7040a8a6fd54e1b42112ec0c87c3c3b567ed641de97a9e2335b57a2efb075491f641e5b977bc226a474276bea0c3c3c71d8d6ac54d
| * | Avoid dereference-of-casted-pointerPieter Wuille2017-07-071-2/+2
| |/
* / Remove confusing MAX_BLOCK_BASE_SIZE.Gregory Maxwell2017-07-144-22/+1
|/ | | | | | | | | | | | | | | | | | Some people keep thinking that MAX_BLOCK_BASE_SIZE is a separate size limit from the weight limit when it fact it is superfluous, and used in early tests before the witness data has been validated or just to compute worst case sizes. The size checks that use it would not behave any differently consensus wise if they were eliminated completely. Its correct value is not independently settable but is a function of the weight limit and weight formula. This patch just eliminates it and uses the scale factor as required to compute the worse case constants. It also moves the weight factor out of primitives into consensus, which is a more logical place for it.
* Perform member initialization in initialization lists where possiblepracticalswift2017-06-041-4/+1
|
* Consensus: Minimal way to move dust out of consensusJorge Timón2017-05-031-37/+0
|
* Improved efficiency in COutPoint constructorsMarcos Mayorga2017-04-281-2/+2
|
* Merge #9602: Remove coin age priority and free transactions - implementationWladimir J. van der Laan2017-03-072-32/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | b421e6d Update example bitcoin.conf (Alex Morcos) 7d4e950 Allow setting minrelaytxfee to 0 (Alex Morcos) 359e8a0 [cleanup] Remove coin age priority completely. (Alex Morcos) f9b9371 [rpc] Remove priorityDelta from prioritisetransaction (Alex Morcos) 49be7e1 [rpc] Remove priority information from mempool RPC calls (Alex Morcos) 0315888 [test] Remove priority from tests (Alex Morcos) f838005 No longer allow "free" transactions (Alex Morcos) ad727f4 [rpc] sendrawtransaction no longer bypasses minRelayTxFee (Alex Morcos) fe282ac [cleanup] Remove estimatePriority and estimateSmartPriority (Alex Morcos) 400b151 [debug] Change -printpriority option (Alex Morcos) 272b25a [mining] Remove -blockprioritysize. (Alex Morcos) 12839cd [rpc] Remove estimatepriority and estimatesmartpriority. (Alex Morcos) ddf58c7 wallet: Remove sendfree (MarcoFalke) Tree-SHA512: a9a4499405923ce794ef18f9e334dbbd59dfc73a3dc2df6f85cc9c62af6f353ec2eed9c2d5e58e904f918d0d7ab738f403dd4939d9bc2276136864fe63710782
| * [cleanup] Remove coin age priority completely.Alex Morcos2017-03-032-32/+0
| | | | | | | | Remove GetPriority and ComputePriority. Remove internal machinery for tracking priority in CTxMemPoolEntry.
* | Optimize GetWitnessHash() for non-segwit transactionsSuhas Daftuar2017-03-031-0/+3
|/
* Merge #9283: A few more CTransactionRef optimizationsWladimir J. van der Laan2017-01-041-2/+0
|\ | | | | | | | | | | | | 91335ba Remove unused MakeTransactionRef overloads (Pieter Wuille) 6713f0f Make FillBlock consume txn_available to avoid shared_ptr copies (Pieter Wuille) 62607d7 Convert COrphanTx to keep a CTransactionRef (Pieter Wuille) c44e4c4 Make AcceptToMemoryPool take CTransactionRef (Pieter Wuille)
| * Remove unused MakeTransactionRef overloadsPieter Wuille2016-12-211-2/+0
| |
* | Increment MIT Licence copyright header year on files modified in 2016isle29832016-12-314-4/+4
|/ | | | | | Edited via: $ contrib/devtools/copyright_header.py update .
* Merge #8589: Inline CTxInWitness inside CTxInWladimir J. van der Laan2016-12-212-73/+36
|\ | | | | | | f6fb7ac Move CTxInWitness inside CTxIn (Pieter Wuille)
| * Move CTxInWitness inside CTxInPieter Wuille2016-12-042-73/+36
| |
* | Bump default transaction version to 2BtcDrak2016-12-081-1/+1
|/
* Make CTransaction actually immutablePieter Wuille2016-12-022-90/+87
|