mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +02:00
[mempool] add GetPrioritisedTransactions
This commit is contained in:
parent
ccd4db7d62
commit
9e9ca36c80
2 changed files with 29 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue