Browse Source

Modify variable names for entry height and priority

0.13
Alex Morcos 10 years ago
parent
commit
71f1d9fd4a
  1. 10
      src/txmempool.cpp
  2. 8
      src/txmempool.h

10
src/txmempool.cpp

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

8
src/txmempool.h

@ -63,8 +63,8 @@ private:
size_t nModSize; //! ... and modified size for priority size_t nModSize; //! ... and modified size for priority
size_t nUsageSize; //! ... and total memory usage size_t nUsageSize; //! ... and total memory usage
int64_t nTime; //! Local time when entering the mempool int64_t nTime; //! Local time when entering the mempool
double dPriority; //! Priority when entering the mempool double entryPriority; //! Priority when entering the mempool
unsigned int nHeight; //! Chain height 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 bool hadNoDependencies; //! Not dependent on any other txs when it entered the mempool
// Information about descendants of this transaction that are in the // Information about descendants of this transaction that are in the
@ -78,7 +78,7 @@ private:
public: public:
CTxMemPoolEntry(const CTransaction& _tx, const CAmount& _nFee, CTxMemPoolEntry(const CTransaction& _tx, const CAmount& _nFee,
int64_t _nTime, double _dPriority, unsigned int _nHeight, bool poolHasNoInputsOf); int64_t _nTime, double _entryPriority, unsigned int _entryHeight, bool poolHasNoInputsOf);
CTxMemPoolEntry(const CTxMemPoolEntry& other); CTxMemPoolEntry(const CTxMemPoolEntry& other);
const CTransaction& GetTx() const { return this->tx; } const CTransaction& GetTx() const { return this->tx; }
@ -86,7 +86,7 @@ public:
const CAmount& GetFee() const { return nFee; } const CAmount& GetFee() const { return nFee; }
size_t GetTxSize() const { return nTxSize; } size_t GetTxSize() const { return nTxSize; }
int64_t GetTime() const { return nTime; } int64_t GetTime() const { return nTime; }
unsigned int GetHeight() const { return nHeight; } unsigned int GetHeight() const { return entryHeight; }
bool WasClearAtEntry() const { return hadNoDependencies; } bool WasClearAtEntry() const { return hadNoDependencies; }
size_t DynamicMemoryUsage() const { return nUsageSize; } size_t DynamicMemoryUsage() const { return nUsageSize; }

Loading…
Cancel
Save