aboutsummaryrefslogtreecommitdiff
path: root/src/txmempool.cpp
diff options
context:
space:
mode:
authorPieter Wuille <[email protected]>2014-09-15 07:24:05 +0200
committerPieter Wuille <[email protected]>2014-09-15 07:29:04 +0200
commit2ec82e94e6b49a0e74243559b96ee736c0c54de7 (patch)
treede499243eaa1d1563ba9c342299f5018cc5fa43d /src/txmempool.cpp
parentMerge pull request #4909 (diff)
parentTrack modified size in TxMemPoolEntry so that we can correctly compute priority. (diff)
downloaddiscoin-2ec82e94e6b49a0e74243559b96ee736c0c54de7.tar.xz
discoin-2ec82e94e6b49a0e74243559b96ee736c0c54de7.zip
Merge pull request #4817
c26649f Track modified size in TxMemPoolEntry so that we can correctly compute priority. (Alex Morcos)
Diffstat (limited to 'src/txmempool.cpp')
-rw-r--r--src/txmempool.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/txmempool.cpp b/src/txmempool.cpp
index 6bbadc834..119509ae3 100644
--- a/src/txmempool.cpp
+++ b/src/txmempool.cpp
@@ -23,6 +23,8 @@ CTxMemPoolEntry::CTxMemPoolEntry(const CTransaction& _tx, int64_t _nFee,
tx(_tx), nFee(_nFee), nTime(_nTime), dPriority(_dPriority), nHeight(_nHeight)
{
nTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);
+
+ nModSize = tx.CalculateModifiedSize(nTxSize);
}
CTxMemPoolEntry::CTxMemPoolEntry(const CTxMemPoolEntry& other)
@@ -34,7 +36,7 @@ double
CTxMemPoolEntry::GetPriority(unsigned int currentHeight) const
{
int64_t nValueIn = tx.GetValueOut()+nFee;
- double deltaPriority = ((double)(currentHeight-nHeight)*nValueIn)/nTxSize;
+ double deltaPriority = ((double)(currentHeight-nHeight)*nValueIn)/nModSize;
double dResult = dPriority + deltaPriority;
return dResult;
}