Skip to content

Commit f761f03

Browse files
committed
mempool: Don't sort in entryAll
Current call sites of entryAll do not require the entries to be sorted, so iterate through mapTx directly to retrieve the entries instead of using SortedDepthAndScore.
1 parent 6d57909 commit f761f03

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/txmempool.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -829,13 +829,7 @@ static TxMempoolInfo GetInfo(CTxMemPool::indexed_transaction_set::const_iterator
829829
std::vector<CTxMemPoolEntryRef> CTxMemPool::entryAll() const
830830
{
831831
AssertLockHeld(cs);
832-
833-
std::vector<CTxMemPoolEntryRef> ret;
834-
ret.reserve(mapTx.size());
835-
for (const auto& it : GetSortedDepthAndScore()) {
836-
ret.emplace_back(*it);
837-
}
838-
return ret;
832+
return {mapTx.begin(), mapTx.end()};
839833
}
840834

841835
std::vector<TxMempoolInfo> CTxMemPool::infoAll() const

0 commit comments

Comments
 (0)