aboutsummaryrefslogtreecommitdiff
path: root/src/primitives/transaction.h
AgeCommit message (Collapse)Author
2022-07-25refactor: Make CTransaction constructor explicitMacroFake
It involves calculating two hashes, so the performance impact should be made explicit. Also, add the module to iwyu.
2022-02-19Merge bitcoin/bitcoin#24350: Primitives: Correct CTransaction ↵MarcoFalke
deserialization docstring d4b3483cece9c27d58e4026df35725655ce06cf5 Primitives: Correct CTransaction deserialization docstring (TheCharlatan) Pull request description: Since https://github.com/bitcoin/bitcoin/pull/8589 CTxWitness was removed and instead replaced with CScriptWitness inside each CTxIn. ACKs for top commit: w0xlt: ACK d4b3483 Tree-SHA512: 02bb73e8a7d1fc449e4776a162009261baecc573837fade74ad7d76b3cd63200424e02fd0abd000c63706072f2ab3c95d3053139495b81347463f43e56192ca9
2022-02-15Primitives: Correct CTransaction deserialization docstringTheCharlatan
Since https://github.com/bitcoin/bitcoin/pull/8589 CTxWitness was removed and instead replaced with CScriptWitness inside each CTxIn.
2022-01-26Extract CTxIn::MAX_SEQUENCE_NONFINAL constantMarcoFalke
2021-12-30scripted-diff: Bump copyright headersHennadii Stepanov
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT- Commits of previous years: * 2020: fa0074e2d82928016a43ca408717154a1c70a4db * 2019: aaaaad6ac95b402fe18d019d67897ced6b316ee0
2021-10-22Make GenTxid boolean constructor privateMarcoFalke
2021-10-21create explicit GenTxid::{Txid, Wtxid} ctorsglozow
2021-09-30[MOVEONLY] consensus: move amount.h into consensusfanquake
Move amount.h to consensus/amount.h. Renames, adds missing and removes uneeded includes.
2020-12-31scripted-diff: Bump copyright headersMarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
2020-12-15Merge #20611: Move TX_MAX_STANDARD_VERSION to policyWladimir J. van der Laan
fade6195b1c230edd561443637a7bde81c2594a4 Move TX_MAX_STANDARD_VERSION to policy (MarcoFalke) Pull request description: `primitives` should only be used for the raw datastructures (parsing and format). It is not the right place to document relay policy. ACKs for top commit: laanwj: Code review ACK fade6195b1c230edd561443637a7bde81c2594a4 lontivero: Concept ACK https://github.com/bitcoin/bitcoin/pull/20611/commits/fade6195b1c230edd561443637a7bde81c2594a4 Tree-SHA512: f809c4aecd14d7e9feaa7b50b9c0697232991eef36190cd960bcfb0ad6e20c71a4f6aab48c7747cf8a681eb14feda60c55b09a37f128673d519567224f29cd97
2020-12-10Move TX_MAX_STANDARD_VERSION to policyMarcoFalke
Also remove extraneous whitespace, should be reviewed with --ignore-all-space
2020-12-07Remove unused and confusing CTransaction constructorMarcoFalke
2020-10-12Report and verify expirationsPieter Wuille
2020-09-17net: CNetAddr: add support to (un)serialize as ADDRv2Vasil Dimov
Co-authored-by: Carl Dong <contact@carldong.me>
2020-07-30refactor: add GenTxid (=txid or wtxid) type and use it for tx request logicPieter Wuille
2020-05-20Merge #18317: Serialization improvements step 6 (all except wallet/gui)MarcoFalke
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
2020-05-03Remove CCoinsViewCache::GetValueIn(...)practicalswift
2020-03-30Convert everything except wallet/qt to new serializationPieter Wuille
2019-12-30scripted-diff: Bump copyright of files changed in 2019MarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
2019-04-25Merge #14039: Disallow extended encoding for non-witness transactionsMarcoFalke
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
2018-12-17 Made expicit constructor CTransaction(const CMutableTransaction &tx).lucash-dev
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.
2018-11-30Use const in COutPoint classHennadii Stepanov
2018-10-18Avoid 1 << 31 (UB) in calculation of SEQUENCE_LOCKTIME_DISABLE_FLAGpracticalswift
2018-09-26doxygen: Fix member commentsMarcoFalke
2018-08-23Disallow extended encoding for non-witness transactionsPieter Wuille
2018-07-27Update copyright headers to 2018DrahtBot
2018-06-10Removed unused == operator from CMutableTransaction.lucash.dev@gmail.com
2018-05-04Cache witness hash in CTransactionMarcoFalke
2018-05-04Make CMutableTransaction constructor explicitMarcoFalke
Silently converting to a CMutableTransaction will drop all caches and should thus be done explicitly
2018-01-03Increment MIT Licence copyright header year on files modified in 2017Akira Takizawa
2017-11-16scripted-diff: Replace #include "" with #include <> (ryanofsky)MeshCollider
-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-
2017-09-06Merge #8330: Structure Packing Optimizations in C{,Mutable}TransactionWladimir J. van der Laan
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
2017-07-15Merge #10760: Avoid dereference-of-casted-pointerPieter Wuille
0aadc11fd Avoid dereference-of-casted-pointer (Pieter Wuille) Pull request description: And prefer a static_cast to the intended reference type. Tree-SHA512: e83b20023a4dca6029b46f7040a8a6fd54e1b42112ec0c87c3c3b567ed641de97a9e2335b57a2efb075491f641e5b977bc226a474276bea0c3c3c71d8d6ac54d
2017-07-14Remove confusing MAX_BLOCK_BASE_SIZE.Gregory Maxwell
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.
2017-07-12Reorder C{,Mutable}Transaction for better packingJeremy Rubin
2017-07-07Avoid dereference-of-casted-pointerPieter Wuille
2017-05-03Consensus: Minimal way to move dust out of consensusJorge Timón
2017-04-28Improved efficiency in COutPoint constructorsMarcos Mayorga
2017-03-03[cleanup] Remove coin age priority completely.Alex Morcos
Remove GetPriority and ComputePriority. Remove internal machinery for tracking priority in CTxMemPoolEntry.
2017-01-04Merge #9283: A few more CTransactionRef optimizationsWladimir J. van der Laan
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)
2016-12-31Increment MIT Licence copyright header year on files modified in 2016isle2983
Edited via: $ contrib/devtools/copyright_header.py update .
2016-12-21Remove unused MakeTransactionRef overloadsPieter Wuille
2016-12-21Merge #8589: Inline CTxInWitness inside CTxInWladimir J. van der Laan
f6fb7ac Move CTxInWitness inside CTxIn (Pieter Wuille)
2016-12-08Bump default transaction version to 2BtcDrak
2016-12-04Move CTxInWitness inside CTxInPieter Wuille
2016-12-02Make CTransaction actually immutablePieter Wuille
2016-11-19Introduce convenience type CTransactionRefPieter Wuille
2016-11-19Add deserializing constructors to CTransaction and CMutableTransactionPieter Wuille
2016-11-07Get rid of nType and nVersionPieter Wuille
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.
2016-11-07Make GetSerializeSize a wrapper on top of CSizeComputerPieter Wuille
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.