diff --git a/core/src/main/java/bisq/core/dao/burningman/BurningManService.java b/core/src/main/java/bisq/core/dao/burningman/BurningManService.java index 2d72e734a42..1e63bb87f72 100644 --- a/core/src/main/java/bisq/core/dao/burningman/BurningManService.java +++ b/core/src/main/java/bisq/core/dao/burningman/BurningManService.java @@ -48,6 +48,7 @@ import java.util.Map; import java.util.Optional; import java.util.Set; +import java.util.TreeMap; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -111,7 +112,7 @@ public BurningManService(DaoStateService daoStateService, /////////////////////////////////////////////////////////////////////////////////////////// Map getBurningManCandidatesByName(int chainHeight) { - Map burningManCandidatesByName = new HashMap<>(); + Map burningManCandidatesByName = new TreeMap<>(); Map> proofOfBurnOpReturnTxOutputByHash = getProofOfBurnOpReturnTxOutputByHash(chainHeight); // Add contributors who made a compensation request @@ -120,8 +121,7 @@ Map getBurningManCandidatesByName(int chainHeight) .forEach(issuance -> { getCompensationProposalsForIssuance(issuance).forEach(compensationProposal -> { String name = compensationProposal.getName(); - burningManCandidatesByName.putIfAbsent(name, new BurningManCandidate()); - BurningManCandidate candidate = burningManCandidatesByName.get(name); + BurningManCandidate candidate = burningManCandidatesByName.computeIfAbsent(name, n -> new BurningManCandidate()); // Issuance Optional customAddress = compensationProposal.getBurningManReceiverAddress();