[#CTxMemPool-ExtractBestByMiningScoreWithTopology] = xref:CTxMemPool.adoc[CTxMemPool]::ExtractBestByMiningScoreWithTopology :relfileprefix: ../ :mrdocs: Look up wtxids in the mempool and (partially) sort by mining score. == Synopsis Declared in `<txmempool.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[requires_capability(0x7ff37b41f8f8), requires_capability(0x7ff376fd72a8), requires_capability(0x7ff38def64c8), requires_capability(0x7ff3640f74d8), requires_capability(0x7ff3920f77c8), requires_capability(0x7ff37f5c98e8), requires_capability(0x7ff37d010b68), requires_capability(0x7ff374c14378)]] std::vector<txiter> ExtractBestByMiningScoreWithTopology( std::vector<Wtxid>& wtxids, size_t n_to_sort) const; ---- == Description The `n_to_sort` best entries are removed from `wtxids` and their corresponding txiter entries are returned. In addition wtxids that are duplicates or were not found in the mempool are silently dropped from `wtxids.` The returned vector is ordered from best to worst (by CompareMainOrder). Entries remaining in `wtxids` are in unspecified order. Note that the returned `txiter` values may become invalidated once mempool.cs is released. == Return Value The extracted iterators, ordered from best to worst by mining score. == Parameters [cols="1,4"] |=== | Name| Description | *wtxids* [inout] | The wtxids to look up; sorted best entries are removed from it. | *n_to_sort* [in] | The number of best entries to extract. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#