[#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(0x7f2e1b5a1f28), requires_capability(0x7f2e2721af38), requires_capability(0x7f2e421cc648), requires_capability(0x7f2e2880b608), requires_capability(0x7f2e3212e998), requires_capability(0x7f2e347f7028), requires_capability(0x7f2e2b05b498), requires_capability(0x7f2e2bee2b38)]] 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]#