mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-05-29 05:11:44 +02:00
Mark CTxMemPoolEntry members that should not be modified const
This commit is contained in:
parent
fa5ed4f8d2
commit
ddd395f968
@ -20,13 +20,10 @@
|
|||||||
|
|
||||||
CTxMemPoolEntry::CTxMemPoolEntry(const CTransactionRef& _tx, const CAmount& _nFee,
|
CTxMemPoolEntry::CTxMemPoolEntry(const CTransactionRef& _tx, const CAmount& _nFee,
|
||||||
int64_t _nTime, unsigned int _entryHeight,
|
int64_t _nTime, unsigned int _entryHeight,
|
||||||
bool _spendsCoinbase, int64_t _sigOpsCost, LockPoints lp):
|
bool _spendsCoinbase, int64_t _sigOpsCost, LockPoints lp)
|
||||||
tx(_tx), nFee(_nFee), nTime(_nTime), entryHeight(_entryHeight),
|
: tx(_tx), nFee(_nFee), nTxWeight(GetTransactionWeight(*tx)), nUsageSize(RecursiveDynamicUsage(tx)), nTime(_nTime), entryHeight(_entryHeight),
|
||||||
spendsCoinbase(_spendsCoinbase), sigOpCost(_sigOpsCost), lockPoints(lp)
|
spendsCoinbase(_spendsCoinbase), sigOpCost(_sigOpsCost), lockPoints(lp)
|
||||||
{
|
{
|
||||||
nTxWeight = GetTransactionWeight(*tx);
|
|
||||||
nUsageSize = RecursiveDynamicUsage(tx);
|
|
||||||
|
|
||||||
nCountWithDescendants = 1;
|
nCountWithDescendants = 1;
|
||||||
nSizeWithDescendants = GetTxSize();
|
nSizeWithDescendants = GetTxSize();
|
||||||
nModFeesWithDescendants = nFee;
|
nModFeesWithDescendants = nFee;
|
||||||
|
@ -64,14 +64,14 @@ class CTxMemPool;
|
|||||||
class CTxMemPoolEntry
|
class CTxMemPoolEntry
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
CTransactionRef tx;
|
const CTransactionRef tx;
|
||||||
CAmount nFee; //!< Cached to avoid expensive parent-transaction lookups
|
const CAmount nFee; //!< Cached to avoid expensive parent-transaction lookups
|
||||||
size_t nTxWeight; //!< ... and avoid recomputing tx weight (also used for GetTxSize())
|
const size_t nTxWeight; //!< ... and avoid recomputing tx weight (also used for GetTxSize())
|
||||||
size_t nUsageSize; //!< ... and total memory usage
|
const size_t nUsageSize; //!< ... and total memory usage
|
||||||
int64_t nTime; //!< Local time when entering the mempool
|
const int64_t nTime; //!< Local time when entering the mempool
|
||||||
unsigned int entryHeight; //!< Chain height when entering the mempool
|
const unsigned int entryHeight; //!< Chain height when entering the mempool
|
||||||
bool spendsCoinbase; //!< keep track of transactions that spend a coinbase
|
const bool spendsCoinbase; //!< keep track of transactions that spend a coinbase
|
||||||
int64_t sigOpCost; //!< Total sigop cost
|
const int64_t sigOpCost; //!< Total sigop cost
|
||||||
int64_t feeDelta; //!< Used for determining the priority of the transaction for mining in a block
|
int64_t feeDelta; //!< Used for determining the priority of the transaction for mining in a block
|
||||||
LockPoints lockPoints; //!< Track the height and time at which tx was final
|
LockPoints lockPoints; //!< Track the height and time at which tx was final
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user