Skip to content

Commit

Permalink
fix: align sorting of inputs by rounds to Dash Core (C++) (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
HashEngineering authored Aug 14, 2024
1 parent b5abdeb commit 60cd906
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1500,11 +1500,9 @@ public boolean submitDenominate() {
}

// more inputs first, for equal input count prefer the one with fewer rounds
Collections.sort(vecInputsByRounds, new Comparator<Pair<Integer, Integer>>() {
@Override
public int compare(Pair<Integer, Integer> a, Pair<Integer, Integer> b) {
return (a.getSecond() > b.getSecond()) ? a.getSecond() - b.getSecond() : a.getFirst() - b.getFirst();
}
vecInputsByRounds.sort((a, b) -> {
int inputCompare = Integer.compare(b.getSecond(), a.getSecond());
return inputCompare != 0 ? inputCompare : Integer.compare(a.getFirst(), b.getFirst());
});

log.info("coinjoin: vecInputsByRounds(size={}) for denom {}", vecInputsByRounds.size(), sessionDenom);
Expand Down

0 comments on commit 60cd906

Please sign in to comment.