diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 2e3c4a1e53499..0ee9e728a59fb 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -874,6 +874,10 @@ void CTxMemPool::queryHashes(std::vector& vtxid) } } +static TxMempoolInfo GetInfo(CTxMemPool::indexed_transaction_set::const_iterator it) { + return TxMempoolInfo{it->GetSharedTx(), it->GetTime(), CFeeRate(it->GetFee(), it->GetTxSize()), it->GetModifiedFee() - it->GetFee()}; +} + std::vector CTxMemPool::infoAll() const { LOCK(cs); @@ -882,7 +886,7 @@ std::vector CTxMemPool::infoAll() const std::vector ret; ret.reserve(mapTx.size()); for (auto it : iters) { - ret.emplace_back(TxMempoolInfo{it->GetSharedTx(), it->GetTime(), CFeeRate(it->GetFee(), it->GetTxSize())}); + ret.emplace_back(GetInfo(it)); } return ret; @@ -912,7 +916,7 @@ TxMempoolInfo CTxMemPool::info(const uint256& hash) const indexed_transaction_set::const_iterator i = mapTx.find(hash); if (i == mapTx.end()) return TxMempoolInfo(); - return TxMempoolInfo{i->GetSharedTx(), i->GetTime(), CFeeRate(i->GetFee(), i->GetTxSize())}; + return GetInfo(i); } CFeeRate CTxMemPool::estimateFee(int nBlocks) const diff --git a/src/txmempool.h b/src/txmempool.h index b108c04a76774..d235013d2cd86 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -299,6 +299,9 @@ struct TxMempoolInfo /** Feerate of the transaction. */ CFeeRate feeRate; + + /** The fee delta. */ + int64_t nFeeDelta; }; /**