| 297 | } |
| 298 | |
| 299 | void BlockAssembler::SortForBlock(const CTxMemPool::setEntries& package, std::vector<CTxMemPool::txiter>& sortedEntries) |
| 300 | { |
| 301 | // Sort package by ancestor count |
| 302 | // If a transaction A depends on transaction B, then A's ancestor count |
| 303 | // must be greater than B's. So this is sufficient to validly order the |
| 304 | // transactions for block inclusion. |
| 305 | sortedEntries.clear(); |
| 306 | sortedEntries.insert(sortedEntries.begin(), package.begin(), package.end()); |
| 307 | std::sort(sortedEntries.begin(), sortedEntries.end(), CompareTxIterByAncestorCount()); |
| 308 | } |
| 309 | |
| 310 | // This transaction selection algorithm orders the mempool based |
| 311 | // on feerate of a transaction including all unconfirmed ancestors. |
nothing calls this directly
no test coverage detected