aboutsummaryrefslogtreecommitdiff
path: root/src/txmempool.h
diff options
context:
space:
mode:
authorSuhas Daftuar <sdaftuar@gmail.com>2018-01-13 15:57:30 -0500
committerSuhas Daftuar <sdaftuar@gmail.com>2018-01-13 15:57:30 -0500
commit0a22a52918ad5af6d105b4f5ae9dd6c52199f0e8 (patch)
treecdfe7f594d10c2c80a3f49a8c014fa6b191f94e5 /src/txmempool.h
parent7abfa538b5a4508e0cf0589ae3ac0620b2188912 (diff)
downloadbitcoin-0a22a52918ad5af6d105b4f5ae9dd6c52199f0e8.tar.xz
Use mempool's ancestor sort in transaction selection
Transaction selection for mining tracks ancestor feerates that are modified based on transactions that have already been selected. This commit de-duplicates the code so that the ancestor feerate sorting used by the mempool can also be directly applied to the miner.
Diffstat (limited to 'src/txmempool.h')
-rw-r--r--src/txmempool.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/txmempool.h b/src/txmempool.h
index a5eba9787e..d32131d7a8 100644
--- a/src/txmempool.h
+++ b/src/txmempool.h
@@ -273,7 +273,8 @@ public:
class CompareTxMemPoolEntryByAncestorFee
{
public:
- bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b) const
+ template<typename T>
+ bool operator()(const T& a, const T& b) const
{
double a_mod_fee, a_size, b_mod_fee, b_size;
@@ -291,7 +292,8 @@ public:
}
// Return the fee/size we're using for sorting this entry.
- void GetModFeeAndSize(const CTxMemPoolEntry &a, double &mod_fee, double &size) const
+ template <typename T>
+ void GetModFeeAndSize(const T &a, double &mod_fee, double &size) const
{
// Compare feerate with ancestors to feerate of the transaction, and
// return the fee/size for the min.