From 3131b265a5c9c18d33af4ee67b273ab4df1bf4a1 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Mon, 13 Dec 2021 15:42:02 +0200 Subject: [PATCH] ensure selected utxo sets retain stable ordering --- src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java b/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java index 4a9633c..232c79a 100644 --- a/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java +++ b/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java @@ -932,7 +932,7 @@ public class Wallet extends Persistable implements Comparable { Map utxos = getWalletUtxos(includeSpentMempoolOutputs); for(Collection selectedInputs : selectedInputSets) { total += selectedInputs.stream().mapToLong(BlockTransactionHashIndex::getValue).sum(); - Map selectedInputsMap = new HashMap<>(utxos); + Map selectedInputsMap = new TreeMap<>(utxos); selectedInputsMap.keySet().retainAll(selectedInputs); selectedInputSetsList.add(selectedInputsMap); }