diff --git a/src/txmempool.h b/src/txmempool.h --- a/src/txmempool.h +++ b/src/txmempool.h @@ -66,21 +66,21 @@ class CTxMemPoolEntry { private: - CTransactionRef tx; + const CTransactionRef tx; //!< Cached to avoid expensive parent-transaction lookups - Amount nFee; + const Amount nFee; //!< ... and avoid recomputing tx size - size_t nTxSize; + const size_t nTxSize; //!< ... and total memory usage - size_t nUsageSize; + const size_t nUsageSize; //!< Local time when entering the mempool - int64_t nTime; + const int64_t nTime; //!< Chain height when entering the mempool - unsigned int entryHeight; + const unsigned int entryHeight; //!< keep track of transactions that spend a coinbase - bool spendsCoinbase; + const bool spendsCoinbase; //!< Total sigop plus P2SH sigops count - int64_t sigOpCount; + const int64_t sigOpCount; //!< Used for determining the priority of the transaction for mining in a //! block Amount feeDelta; diff --git a/src/txmempool.cpp b/src/txmempool.cpp --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -29,12 +29,10 @@ int64_t _nTime, unsigned int _entryHeight, bool _spendsCoinbase, int64_t _sigOpsCount, LockPoints lp) - : tx(_tx), nFee(_nFee), nTime(_nTime), entryHeight(_entryHeight), - spendsCoinbase(_spendsCoinbase), sigOpCount(_sigOpsCount), - lockPoints(lp) { - nTxSize = tx->GetTotalSize(); - nUsageSize = RecursiveDynamicUsage(tx); - + : tx(_tx), nFee(_nFee), nTxSize(tx->GetTotalSize()), + nUsageSize(RecursiveDynamicUsage(tx)), nTime(_nTime), + entryHeight(_entryHeight), spendsCoinbase(_spendsCoinbase), + sigOpCount(_sigOpsCount), lockPoints(lp) { nCountWithDescendants = 1; nSizeWithDescendants = GetTxSize(); nModFeesWithDescendants = nFee;