Skip to content

Commit

Permalink
Merge pull request #9223
Browse files Browse the repository at this point in the history
36ee12b get_block_template_backlog: better sorting logic (SChernykh)
  • Loading branch information
luigi1111 committed Mar 8, 2024
2 parents c225a1f + 36ee12b commit 5eb3fc2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cryptonote_core/tx_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5eb3fc2

Please sign in to comment.