Skip to content

Commit

Permalink
Modify variable names for entry height and priority
Browse files Browse the repository at this point in the history
Coming from btc@71f1d9fd4ae2c2fc90d5487bdf2096f9eb5898d9
  • Loading branch information
furszy committed Jul 3, 2020
1 parent 4356b31 commit 07eae9f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/txmempool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@


CTxMemPoolEntry::CTxMemPoolEntry(const CTransaction& _tx, const CAmount& _nFee,
int64_t _nTime, double _dPriority,
unsigned int _nHeight, bool poolHasNoInputsOf) :
tx(_tx), nFee(_nFee), nTime(_nTime), dPriority(_dPriority), nHeight(_nHeight), hadNoDependencies(poolHasNoInputsOf)
int64_t _nTime, double _entryPriority,
unsigned int _entryHeight, bool poolHasNoInputsOf) :
tx(_tx), nFee(_nFee), nTime(_nTime), entryPriority(_entryPriority), entryHeight(_entryHeight), hadNoDependencies(poolHasNoInputsOf)
{
nTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);
nModSize = tx.CalculateModifiedSize(nTxSize);
Expand All @@ -44,8 +44,8 @@ double
CTxMemPoolEntry::GetPriority(unsigned int currentHeight) const
{
CAmount nValueIn = tx.GetValueOut() + nFee;
double deltaPriority = ((double)(currentHeight - nHeight) * nValueIn) / nModSize;
double dResult = dPriority + deltaPriority;
double deltaPriority = ((double)(currentHeight - entryHeight) * nValueIn) / nModSize;
double dResult = entryPriority + deltaPriority;
return dResult;
}

Expand Down
8 changes: 4 additions & 4 deletions src/txmempool.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ class CTxMemPoolEntry
CFeeRate feeRate; //! ... and fee per kB
bool hasZerocoins{false}; //! ... and checking if it contains zPIV (mints/spends)
int64_t nTime; //! Local time when entering the mempool
double dPriority; //! Priority when entering the mempool
unsigned int nHeight; //! Chain height when entering the mempool
double entryPriority; //! Priority when entering the mempool
unsigned int entryHeight; //! Chain height when entering the mempool
bool hadNoDependencies; //! Not dependent on any other txs when it entered the mempool

// Information about descendants of this transaction that are in the
Expand All @@ -80,15 +80,15 @@ class CTxMemPoolEntry
CAmount nFeesWithDescendants; //! ... and total fees (all including us)

public:
CTxMemPoolEntry(const CTransaction& _tx, const CAmount& _nFee, int64_t _nTime, double _dPriority, unsigned int _nHeight, bool poolHasNoInputsOf = false);
CTxMemPoolEntry(const CTransaction& _tx, const CAmount& _nFee, int64_t _nTime, double _entryPriority, unsigned int _entryHeight, bool poolHasNoInputsOf = false);
CTxMemPoolEntry(const CTxMemPoolEntry& other);

const CTransaction& GetTx() const { return this->tx; }
double GetPriority(unsigned int currentHeight) const;
const CAmount& GetFee() const { return nFee; }
size_t GetTxSize() const { return nTxSize; }
int64_t GetTime() const { return nTime; }
unsigned int GetHeight() const { return nHeight; }
unsigned int GetHeight() const { return entryHeight; }
bool HasZerocoins() const { return hasZerocoins; }
bool WasClearAtEntry() const { return hadNoDependencies; }
size_t DynamicMemoryUsage() const { return nUsageSize; }
Expand Down

0 comments on commit 07eae9f

Please sign in to comment.