[#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(0x7f95135d1ff8), requires_capability(0x7f9501b113d8), requires_capability(0x7f950ec775c8), requires_capability(0x7f9525ea7318), requires_capability(0x7f9515096a58), requires_capability(0x7f950826acf8), requires_capability(0x7f94f856e408), requires_capability(0x7f9513c585f8)]] 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]#