From 45d2dee76448db1a5bd1b341693d9b7f516b7329 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Tue, 20 May 2025 12:04:06 +0200 Subject: [PATCH] remove display of median fee rate where fee rates source is set to server --- .../java/com/sparrowwallet/sparrow/control/BlockCube.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/control/BlockCube.java b/src/main/java/com/sparrowwallet/sparrow/control/BlockCube.java index 2cc3a2aa..33665bc3 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/BlockCube.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/BlockCube.java @@ -26,7 +26,7 @@ public class BlockCube extends Group { public static final double CUBE_SIZE = 60; private final IntegerProperty weightProperty = new SimpleIntegerProperty(0); - private final DoubleProperty medianFeeProperty = new SimpleDoubleProperty(-1.0d); + private final DoubleProperty medianFeeProperty = new SimpleDoubleProperty(-Double.MAX_VALUE); private final IntegerProperty heightProperty = new SimpleIntegerProperty(0); private final IntegerProperty txCountProperty = new SimpleIntegerProperty(0); private final LongProperty timestampProperty = new SimpleLongProperty(System.currentTimeMillis()); @@ -54,8 +54,8 @@ public class BlockCube extends Group { } }); this.medianFeeProperty.addListener((_, _, newValue) -> { - medianFeeText.setText("~" + Math.round(Math.max(newValue.doubleValue(), 1.0d))); - unitsText.setText(" s/vb"); + medianFeeText.setText(newValue.doubleValue() < 0.0d ? "" : "~" + Math.round(Math.max(newValue.doubleValue(), 1.0d))); + unitsText.setText(newValue.doubleValue() < 0.0d ? "" : " s/vb"); double unitsWidth = TextUtils.computeTextWidth(unitsText.getFont(), unitsText.getText(), 0.0d); medianFeeTextFlow.setTranslateX((CUBE_SIZE - (medianFeeText.getLayoutBounds().getWidth() + unitsWidth)) / 2); }); @@ -325,7 +325,7 @@ public class BlockCube extends Group { } public static BlockCube fromBlockSummary(BlockSummary blockSummary) { - return new BlockCube(blockSummary.getWeight().orElse(0), blockSummary.getMedianFee().orElse(1.0d), blockSummary.getHeight(), + return new BlockCube(blockSummary.getWeight().orElse(0), blockSummary.getMedianFee().orElse(-1.0d), blockSummary.getHeight(), blockSummary.getTransactionCount().orElse(0), blockSummary.getTimestamp().getTime(), true); } } \ No newline at end of file