This removes a bunch of boilerplate, makes the code easier to read. Also, C++11 member initialization avoids accidental uninitialized members.
Can be reviewed with the git option “–word-diff-regex=.” or with “git difftool –tool=meld”.
This removes a bunch of boilerplate, makes the code easier to read. Also, C++11 member initialization avoids accidental uninitialized members.
Can be reviewed with the git option “–word-diff-regex=.” or with “git difftool –tool=meld”.
114@@ -115,10 +115,10 @@ class CTxMemPoolEntry
115 int64_t nSigOpCostWithAncestors;
116
117 public:
118- CTxMemPoolEntry(const CTransactionRef& _tx, const CAmount& _nFee,
119- int64_t _nTime, unsigned int _entryHeight,
120- bool spendsCoinbase,
121- int64_t nSigOpsCost, LockPoints lp);
122+ CTxMemPoolEntry(const CTransactionRef& tx, const CAmount& fee,
Feel free to ignore but if you retouch, while changing this function declaration and definition, could also do
0 CTxMemPoolEntry(const CTransactionRef& tx, CAmount fee,
55+ nSizeWithDescendants{GetTxSize()},
56+ nModFeesWithDescendants{nFee},
57+ nCountWithAncestors{1},
58+ nSizeWithAncestors{GetTxSize()},
59+ nModFeesWithAncestors{nFee},
60+ nSigOpCostWithAncestors{sigOpCost} {}
Sorry for painting the bikeshed, but wouldn’t standard project style be to put the body of the function on a new line?
0 nSigOpCostWithAncestors{sigOpCost}
1 {}
{}
, so I think it is fine
47+ nUsageSize{RecursiveDynamicUsage(tx)},
48+ nTime{time},
49+ entryHeight{entry_height},
50+ spendsCoinbase{spends_coinbase},
51+ sigOpCost{sigops_cost},
52+ feeDelta{0},
nCountWithDescendants
and nCountWithAncestors
) with default initialization rather than in the initializer list?
This removes a bunch of boilerplate, makes the code easier to read.
Also, C++11 member initialization avoids accidental uninitialized
members.
Can be reviewed with the git option "--word-diff-regex=." or with "git
difftool --tool=meld".
Concept ACK since #17786 :)
Thanks, took the other diff from there.
Code Review ACK fa08d4cfb1e3447a76093d46edc1c9de5ceee454
This PR simplifies the code, removing unnecessary parts, at the same time, keeping the same functionality. The involved constants are now initialized through default initialization rather than from the function. The Clang Formatting of the PR is correct. So there are no formatting issues either. Thanks, @MarcoFalke, for catching these redundancies.
107 uint64_t nSizeWithDescendants; //!< ... and size
108 CAmount nModFeesWithDescendants; //!< ... and total fees (all including us)
109
110 // Analogous statistics for ancestor transactions
111- uint64_t nCountWithAncestors;
112+ uint64_t nCountWithAncestors{1};