aboutsummaryrefslogtreecommitdiff
path: root/src/primitives
diff options
context:
space:
mode:
authorAlex Morcos <morcos@chaincode.com>2017-01-20 09:24:35 -0500
committerAlex Morcos <morcos@chaincode.com>2017-03-03 16:50:20 -0500
commit359e8a03d1667dca3e8375695131b8b5e6c54f0a (patch)
treeb92b29328bfce5456650488ad40ed87350697b1a /src/primitives
parentf9b9371c6027905f73a2558d6bcaca8a355c28a6 (diff)
[cleanup] Remove coin age priority completely.
Remove GetPriority and ComputePriority. Remove internal machinery for tracking priority in CTxMemPoolEntry.
Diffstat (limited to 'src/primitives')
-rw-r--r--src/primitives/transaction.cpp26
-rw-r--r--src/primitives/transaction.h6
2 files changed, 0 insertions, 32 deletions
diff --git a/src/primitives/transaction.cpp b/src/primitives/transaction.cpp
index 790bc71d14..364a70adcd 100644
--- a/src/primitives/transaction.cpp
+++ b/src/primitives/transaction.cpp
@@ -89,32 +89,6 @@ CAmount CTransaction::GetValueOut() const
return nValueOut;
}
-double CTransaction::ComputePriority(double dPriorityInputs, unsigned int nTxSize) const
-{
- nTxSize = CalculateModifiedSize(nTxSize);
- if (nTxSize == 0) return 0.0;
-
- return dPriorityInputs / nTxSize;
-}
-
-unsigned int CTransaction::CalculateModifiedSize(unsigned int nTxSize) const
-{
- // In order to avoid disincentivizing cleaning up the UTXO set we don't count
- // the constant overhead for each txin and up to 110 bytes of scriptSig (which
- // is enough to cover a compressed pubkey p2sh redemption) for priority.
- // Providing any more cleanup incentive than making additional inputs free would
- // risk encouraging people to create junk outputs to redeem later.
- if (nTxSize == 0)
- nTxSize = (GetTransactionWeight(*this) + WITNESS_SCALE_FACTOR - 1) / WITNESS_SCALE_FACTOR;
- for (std::vector<CTxIn>::const_iterator it(vin.begin()); it != vin.end(); ++it)
- {
- unsigned int offset = 41U + std::min(110U, (unsigned int)it->scriptSig.size());
- if (nTxSize > offset)
- nTxSize -= offset;
- }
- return nTxSize;
-}
-
unsigned int CTransaction::GetTotalSize() const
{
return ::GetSerializeSize(*this, SER_NETWORK, PROTOCOL_VERSION);
diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h
index af2986a41b..d413e8b087 100644
--- a/src/primitives/transaction.h
+++ b/src/primitives/transaction.h
@@ -361,12 +361,6 @@ public:
// GetValueIn() is a method on CCoinsViewCache, because
// inputs must be known to compute value in.
- // Compute priority, given priority of inputs and (optionally) tx size
- double ComputePriority(double dPriorityInputs, unsigned int nTxSize=0) const;
-
- // Compute modified tx size for priority calculation (optionally given tx size)
- unsigned int CalculateModifiedSize(unsigned int nTxSize=0) const;
-
/**
* Get the total transaction size in bytes, including witness data.
* "Total Size" defined in BIP141 and BIP144.