From 26c177bd007dd9e30e9f46c274c1068d36072de5 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Fri, 22 Oct 2021 11:19:26 +0200 Subject: [PATCH] follow up --- .../sparrow/whirlpool/WhirlpoolController.java | 2 +- .../dataSource/SparrowMinerFeeSupplier.java | 15 ++++++++++----- .../sparrowwallet/sparrow/whirlpool/whirlpool.css | 4 ++-- .../sparrow/whirlpool/whirlpool.fxml | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/whirlpool/WhirlpoolController.java b/src/main/java/com/sparrowwallet/sparrow/whirlpool/WhirlpoolController.java index ba1bf96a..05a32be3 100644 --- a/src/main/java/com/sparrowwallet/sparrow/whirlpool/WhirlpoolController.java +++ b/src/main/java/com/sparrowwallet/sparrow/whirlpool/WhirlpoolController.java @@ -139,7 +139,7 @@ public class WhirlpoolController { tx0Previews = null; tx0PreviewProperty.set(null); Tx0FeeTarget tx0FeeTarget = FEE_TARGETS.get(newValue.intValue()); - premixFeeRate.setText(SparrowMinerFeeSupplier.getMinimumFeeForTarget(Integer.parseInt(tx0FeeTarget.getFeeTarget().getValue())) + " sats/vB"); + premixFeeRate.setText(SparrowMinerFeeSupplier.getFee(Integer.parseInt(tx0FeeTarget.getFeeTarget().getValue())) + " sats/vB"); }); premixPriority.setValue(1); diff --git a/src/main/java/com/sparrowwallet/sparrow/whirlpool/dataSource/SparrowMinerFeeSupplier.java b/src/main/java/com/sparrowwallet/sparrow/whirlpool/dataSource/SparrowMinerFeeSupplier.java index abdb345f..778e1748 100644 --- a/src/main/java/com/sparrowwallet/sparrow/whirlpool/dataSource/SparrowMinerFeeSupplier.java +++ b/src/main/java/com/sparrowwallet/sparrow/whirlpool/dataSource/SparrowMinerFeeSupplier.java @@ -26,13 +26,18 @@ public class SparrowMinerFeeSupplier implements MinerFeeSupplier { @Override public int getFee(MinerFeeTarget feeTarget) { - if (AppServices.getTargetBlockFeeRates() == null) { - return FALLBACK_FEE_RATE; - } - return getMinimumFeeForTarget(Integer.parseInt(feeTarget.getValue())); + return getFee(Integer.parseInt(feeTarget.getValue())); } - public static Integer getMinimumFeeForTarget(int targetBlocks) { + public static int getFee(int targetBlocks) { + if(AppServices.getTargetBlockFeeRates() == null) { + return FALLBACK_FEE_RATE; + } + + return getMinimumFeeForTarget(targetBlocks); + } + + private static Integer getMinimumFeeForTarget(int targetBlocks) { List> feeRates = new ArrayList<>(AppServices.getTargetBlockFeeRates().entrySet()); Collections.reverse(feeRates); for(Map.Entry feeRate : feeRates) { diff --git a/src/main/resources/com/sparrowwallet/sparrow/whirlpool/whirlpool.css b/src/main/resources/com/sparrowwallet/sparrow/whirlpool/whirlpool.css index d060e31e..2cfd0f9b 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/whirlpool/whirlpool.css +++ b/src/main/resources/com/sparrowwallet/sparrow/whirlpool/whirlpool.css @@ -38,9 +38,9 @@ } .field-label { - -fx-pref-width: 120px; + -fx-pref-width: 130px; } .field-control { - -fx-pref-width: 160px; + -fx-pref-width: 180px; } \ No newline at end of file diff --git a/src/main/resources/com/sparrowwallet/sparrow/whirlpool/whirlpool.fxml b/src/main/resources/com/sparrowwallet/sparrow/whirlpool/whirlpool.fxml index b5ee6dda..bdc3fdbc 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/whirlpool/whirlpool.fxml +++ b/src/main/resources/com/sparrowwallet/sparrow/whirlpool/whirlpool.fxml @@ -92,7 +92,7 @@