Merge pull request #9223

36ee12b get_block_template_backlog: better sorting logic (SChernykh)
dev-v0.11.2
luigi1111 2 months ago
commit 5eb3fc29bb
No known key found for this signature in database
GPG Key ID: F4ACA0183641E010

@ -1075,7 +1075,7 @@ namespace cryptonote
// If the total weight is too high, choose the best paying transactions
if (total_weight > max_backlog_weight)
std::sort(tmp.begin(), tmp.end(), [](const auto& a, const auto& b){ return a.fee * b.weight > b.fee * a.weight; });
std::stable_sort(tmp.begin(), tmp.end(), [](const auto& a, const auto& b){ return a.fee * b.weight > b.fee * a.weight; });
backlog.clear();
uint64_t w = 0;

Loading…
Cancel
Save