mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-05 05:46:44 +00:00
improve table sorting of utxos with the same hash
This commit is contained in:
parent
6aa3bb2ff3
commit
37a8a0a7f9
1 changed files with 6 additions and 1 deletions
|
@ -35,7 +35,12 @@ public class UtxosTreeTable extends CoinTreeTable {
|
||||||
outputCol.setComparator((o1, o2) -> {
|
outputCol.setComparator((o1, o2) -> {
|
||||||
UtxoEntry entry1 = (UtxoEntry)o1;
|
UtxoEntry entry1 = (UtxoEntry)o1;
|
||||||
UtxoEntry entry2 = (UtxoEntry)o2;
|
UtxoEntry entry2 = (UtxoEntry)o2;
|
||||||
return entry1.getDescription().compareTo(entry2.getDescription());
|
int hashCompare = entry1.getHashIndex().getHash().toString().compareTo(entry2.getHashIndex().getHash().toString());
|
||||||
|
if(hashCompare != 0) {
|
||||||
|
return hashCompare;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (int)(entry1.getHashIndex().getIndex() - entry2.getHashIndex().getIndex());
|
||||||
});
|
});
|
||||||
getColumns().add(outputCol);
|
getColumns().add(outputCol);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue