Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F12945032
D3700.id10362.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D3700.id10362.diff
View Options
diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h
--- a/src/primitives/transaction.h
+++ b/src/primitives/transaction.h
@@ -222,9 +222,9 @@
// actually immutable; deserialization and assignment are implemented,
// and bypass the constness. This is safe, as they update the entire
// structure, including the hash.
- const int32_t nVersion;
const std::vector<CTxIn> vin;
const std::vector<CTxOut> vout;
+ const int32_t nVersion;
const uint32_t nLockTime;
private:
@@ -298,9 +298,9 @@
*/
class CMutableTransaction {
public:
- int32_t nVersion;
std::vector<CTxIn> vin;
std::vector<CTxOut> vout;
+ int32_t nVersion;
uint32_t nLockTime;
CMutableTransaction();
diff --git a/src/primitives/transaction.cpp b/src/primitives/transaction.cpp
--- a/src/primitives/transaction.cpp
+++ b/src/primitives/transaction.cpp
@@ -38,7 +38,7 @@
CMutableTransaction::CMutableTransaction()
: nVersion(CTransaction::CURRENT_VERSION), nLockTime(0) {}
CMutableTransaction::CMutableTransaction(const CTransaction &tx)
- : nVersion(tx.nVersion), vin(tx.vin), vout(tx.vout),
+ : vin(tx.vin), vout(tx.vout), nVersion(tx.nVersion),
nLockTime(tx.nLockTime) {}
static uint256 ComputeCMutableTransactionHash(const CMutableTransaction &tx) {
@@ -62,13 +62,13 @@
* TODO: remove the need for this default constructor entirely.
*/
CTransaction::CTransaction()
- : nVersion(CTransaction::CURRENT_VERSION), vin(), vout(), nLockTime(0),
+ : vin(), vout(), nVersion(CTransaction::CURRENT_VERSION), nLockTime(0),
hash() {}
CTransaction::CTransaction(const CMutableTransaction &tx)
- : nVersion(tx.nVersion), vin(tx.vin), vout(tx.vout),
+ : vin(tx.vin), vout(tx.vout), nVersion(tx.nVersion),
nLockTime(tx.nLockTime), hash(ComputeHash()) {}
CTransaction::CTransaction(CMutableTransaction &&tx)
- : nVersion(tx.nVersion), vin(std::move(tx.vin)), vout(std::move(tx.vout)),
+ : vin(std::move(tx.vin)), vout(std::move(tx.vout)), nVersion(tx.nVersion),
nLockTime(tx.nLockTime), hash(ComputeHash()) {}
Amount CTransaction::GetValueOut() const {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Feb 6, 17:16 (21 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5082765
Default Alt Text
D3700.id10362.diff (2 KB)
Attached To
D3700: Merge #8330: Structure Packing Optimizations in C{,Mutable}Transaction
Event Timeline
Log In to Comment