aboutsummaryrefslogtreecommitdiff
path: root/src/primitives
Commit message (Collapse)AuthorAgeFilesLines
* Disallow extended encoding for non-witness transactionsPieter Wuille2019-05-201-0/+4
| | | | | Github-Pull: #14039 Rebased-From: bb530efa1872ec963417f61da9a95185c7a7a7d6
* 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
|
* Introduce convenience type CTransactionRefPieter Wuille2016-11-192-1/+7
|
* Make CBlock::vtx a vector of shared_ptr<CTransaction>Pieter Wuille2016-11-192-2/+2
|
* Add deserializing constructors to CTransaction and CMutableTransactionPieter Wuille2016-11-192-0/+13
|
* Get rid of nType and nVersionPieter Wuille2016-11-072-15/+16
| | | | | | | | | | | Remove the nType and nVersion as parameters to all serialization methods and functions. There is only one place where it's read and has an impact (in CAddress), and even there it does not impact any of the recursively invoked serializers. Instead, the few places that need nType or nVersion are changed to read it directly from the stream object, through GetType() and GetVersion() methods which are added to all stream classes.
* Make GetSerializeSize a wrapper on top of CSizeComputerPieter Wuille2016-11-071-1/+1
| | | | | | | | | | | Given that in default GetSerializeSize implementations created by ADD_SERIALIZE_METHODS we're already using CSizeComputer(), get rid of the specialized GetSerializeSize methods everywhere, and just use CSizeComputer. This removes a lot of code which isn't actually used anywhere. For CCompactSize and CVarInt this actually removes a more efficient size computing algorithm, which is brought back in a later commit.
* Remove unused CTxOut::GetHash()Matt Corallo2016-11-042-7/+0
|
* Adding method GetTotalSize() to CTransactionHampus Sjöberg2016-09-062-0/+12
| | | | | GetTotalSize() returns the total transaction size (including witness) in bytes.
* Use __func__ to get function name for output printingMarcoFalke2016-08-191-1/+1
|
* Merge #8332: semi trivial: clarify witness branches in transaction.h ↵Wladimir J. van der Laan2016-07-281-3/+5
|\ | | | | | | | | | | serialization e37b16a transaction: clarify witness branches (Daniel Cousens)
| * transaction: clarify witness branchesDaniel Cousens2016-07-141-3/+5
| |
* | Rename "block cost" to "block weight"Suhas Daftuar2016-07-184-9/+9
| |
* | Rename CTxinWitness -> CTxInWitnessBob McElrath2016-07-061-3/+3
|/
* BIP141: Other consensus critical limits, and BIP145Pieter Wuille2016-06-224-5/+42
| | | | Includes changes by Suhas Daftuar, Luke-jr, and mruddy.
* BIP141: Commitment structure and deploymentPieter Wuille2016-06-221-1/+2
| | | | Includes a fix by Suhas Daftuar and LongShao007