mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-07-26 00:15:18 -04:00
[refactor] use lambda.
This commit is contained in:
parent
088334014c
commit
c899466ec4
1 changed files with 18 additions and 21 deletions
|
@ -49,9 +49,7 @@ class AddressBasedCoinSelector implements CoinSelector {
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
static void sortOutputs(ArrayList<TransactionOutput> outputs) {
|
static void sortOutputs(ArrayList<TransactionOutput> outputs) {
|
||||||
Collections.sort(outputs, new Comparator<TransactionOutput>() {
|
Collections.sort(outputs, (a, b) -> {
|
||||||
@Override
|
|
||||||
public int compare(TransactionOutput a, TransactionOutput b) {
|
|
||||||
int depth1 = a.getParentTransactionDepthInBlocks();
|
int depth1 = a.getParentTransactionDepthInBlocks();
|
||||||
int depth2 = b.getParentTransactionDepthInBlocks();
|
int depth2 = b.getParentTransactionDepthInBlocks();
|
||||||
Coin aValue = a.getValue();
|
Coin aValue = a.getValue();
|
||||||
|
@ -69,7 +67,6 @@ class AddressBasedCoinSelector implements CoinSelector {
|
||||||
BigInteger aHash = a.getParentTransactionHash().toBigInteger();
|
BigInteger aHash = a.getParentTransactionHash().toBigInteger();
|
||||||
BigInteger bHash = b.getParentTransactionHash().toBigInteger();
|
BigInteger bHash = b.getParentTransactionHash().toBigInteger();
|
||||||
return aHash.compareTo(bHash);
|
return aHash.compareTo(bHash);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue