MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / SortForBlock

Method SortForBlock

src/miner.cpp:299–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

297}
298
299void 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.

Callers

nothing calls this directly

Calls 5

clearMethod · 0.45
insertMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected