mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-24 22:45:41 +01:00
[mempool] add GetPrioritisedTransactions
This commit is contained in:
@@ -890,6 +890,22 @@ void CTxMemPool::ClearPrioritisation(const uint256& hash)
|
||||
mapDeltas.erase(hash);
|
||||
}
|
||||
|
||||
std::vector<CTxMemPool::delta_info> CTxMemPool::GetPrioritisedTransactions() const
|
||||
{
|
||||
AssertLockNotHeld(cs);
|
||||
LOCK(cs);
|
||||
std::vector<delta_info> result;
|
||||
result.reserve(mapDeltas.size());
|
||||
for (const auto& [txid, delta] : mapDeltas) {
|
||||
const auto iter{mapTx.find(txid)};
|
||||
const bool in_mempool{iter != mapTx.end()};
|
||||
std::optional<CAmount> modified_fee;
|
||||
if (in_mempool) modified_fee = iter->GetModifiedFee();
|
||||
result.emplace_back(delta_info{in_mempool, delta, modified_fee, txid});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
const CTransaction* CTxMemPool::GetConflictTx(const COutPoint& prevout) const
|
||||
{
|
||||
const auto it = mapNextTx.find(prevout);
|
||||
|
||||
Reference in New Issue
Block a user