diff --git a/core/src/main/java/org/bitcoinj/coinjoin/CoinJoinClientSession.java b/core/src/main/java/org/bitcoinj/coinjoin/CoinJoinClientSession.java index 878522365..81725df4c 100644 --- a/core/src/main/java/org/bitcoinj/coinjoin/CoinJoinClientSession.java +++ b/core/src/main/java/org/bitcoinj/coinjoin/CoinJoinClientSession.java @@ -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>() { - @Override - public int compare(Pair a, Pair 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);