Skip to content

Commit c3efb58

Browse files
committed
Add feedelta to TxMempoolInfo
1 parent d2143dc commit c3efb58

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/txmempool.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,10 @@ void CTxMemPool::queryHashes(vector<uint256>& vtxid)
833833
}
834834
}
835835

836+
static TxMempoolInfo GetInfo(CTxMemPool::indexed_transaction_set::const_iterator it) {
837+
return TxMempoolInfo{it->GetSharedTx(), it->GetTime(), CFeeRate(it->GetFee(), it->GetTxSize()), it->GetModifiedFee() - it->GetFee()};
838+
}
839+
836840
std::vector<TxMempoolInfo> CTxMemPool::infoAll() const
837841
{
838842
LOCK(cs);
@@ -841,7 +845,7 @@ std::vector<TxMempoolInfo> CTxMemPool::infoAll() const
841845
std::vector<TxMempoolInfo> ret;
842846
ret.reserve(mapTx.size());
843847
for (auto it : iters) {
844-
ret.push_back(TxMempoolInfo{it->GetSharedTx(), it->GetTime(), CFeeRate(it->GetFee(), it->GetTxSize())});
848+
ret.push_back(GetInfo(it));
845849
}
846850

847851
return ret;
@@ -862,7 +866,7 @@ TxMempoolInfo CTxMemPool::info(const uint256& hash) const
862866
indexed_transaction_set::const_iterator i = mapTx.find(hash);
863867
if (i == mapTx.end())
864868
return TxMempoolInfo();
865-
return TxMempoolInfo{i->GetSharedTx(), i->GetTime(), CFeeRate(i->GetFee(), i->GetTxSize())};
869+
return GetInfo(i);
866870
}
867871

868872
CFeeRate CTxMemPool::estimateFee(int nBlocks) const

src/txmempool.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,9 @@ struct TxMempoolInfo
329329

330330
/** Feerate of the transaction. */
331331
CFeeRate feeRate;
332+
333+
/** The fee delta. */
334+
int64_t nFeeDelta;
332335
};
333336

334337
/**

0 commit comments

Comments
 (0)