|
|
|
@ -19,22 +19,17 @@
|
|
|
|
|
#include "version.h"
|
|
|
|
|
|
|
|
|
|
CTxMemPoolEntry::CTxMemPoolEntry(const CTransactionRef& _tx, const CAmount& _nFee,
|
|
|
|
|
int64_t _nTime, double _entryPriority, unsigned int _entryHeight,
|
|
|
|
|
CAmount _inChainInputValue,
|
|
|
|
|
int64_t _nTime, unsigned int _entryHeight,
|
|
|
|
|
bool _spendsCoinbase, int64_t _sigOpsCost, LockPoints lp):
|
|
|
|
|
tx(_tx), nFee(_nFee), nTime(_nTime), entryPriority(_entryPriority), entryHeight(_entryHeight),
|
|
|
|
|
inChainInputValue(_inChainInputValue),
|
|
|
|
|
tx(_tx), nFee(_nFee), nTime(_nTime), entryHeight(_entryHeight),
|
|
|
|
|
spendsCoinbase(_spendsCoinbase), sigOpCost(_sigOpsCost), lockPoints(lp)
|
|
|
|
|
{
|
|
|
|
|
nTxWeight = GetTransactionWeight(*tx);
|
|
|
|
|
nModSize = tx->CalculateModifiedSize(GetTxSize());
|
|
|
|
|
nUsageSize = RecursiveDynamicUsage(*tx) + memusage::DynamicUsage(tx);
|
|
|
|
|
|
|
|
|
|
nCountWithDescendants = 1;
|
|
|
|
|
nSizeWithDescendants = GetTxSize();
|
|
|
|
|
nModFeesWithDescendants = nFee;
|
|
|
|
|
CAmount nValueIn = tx->GetValueOut()+nFee;
|
|
|
|
|
assert(inChainInputValue <= nValueIn);
|
|
|
|
|
|
|
|
|
|
feeDelta = 0;
|
|
|
|
|
|
|
|
|
@ -49,16 +44,6 @@ CTxMemPoolEntry::CTxMemPoolEntry(const CTxMemPoolEntry& other)
|
|
|
|
|
*this = other;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
double
|
|
|
|
|
CTxMemPoolEntry::GetPriority(unsigned int currentHeight) const
|
|
|
|
|
{
|
|
|
|
|
double deltaPriority = ((double)(currentHeight-entryHeight)*inChainInputValue)/nModSize;
|
|
|
|
|
double dResult = entryPriority + deltaPriority;
|
|
|
|
|
if (dResult < 0) // This should only happen if it was called with a height below entry height
|
|
|
|
|
dResult = 0;
|
|
|
|
|
return dResult;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CTxMemPoolEntry::UpdateFeeDelta(int64_t newFeeDelta)
|
|
|
|
|
{
|
|
|
|
|
nModFeesWithDescendants += newFeeDelta - feeDelta;
|
|
|
|
|