diff --git a/src/main/java/com/sparrowwallet/sparrow/control/BlockCube.java b/src/main/java/com/sparrowwallet/sparrow/control/BlockCube.java index d02e449c..b8722270 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/BlockCube.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/BlockCube.java @@ -52,7 +52,10 @@ public class BlockCube extends Group { public BlockCube(Integer weight, Double medianFee, Integer height, Integer txCount, Long timestamp, boolean confirmed) { getStyleClass().addAll("block-" + Network.getCanonical().getName(), "block-cube"); this.confirmedProperty.set(confirmed); - this.feeRatesSource.set(Config.get().getFeeRatesSource()); + + FeeRatesSource feeRatesSource = Config.get().getFeeRatesSource(); + feeRatesSource = (feeRatesSource == null ? FeeRatesSource.MEMPOOL_SPACE : feeRatesSource); + this.feeRatesSource.set(feeRatesSource); this.weightProperty.addListener((_, _, _) -> { if(front != null) { @@ -198,6 +201,8 @@ public class BlockCube extends Group { } else { feeRateIcon.getChildren().clear(); } + } else { + feeRateIcon.getChildren().clear(); } } } diff --git a/src/main/java/com/sparrowwallet/sparrow/control/RecentBlocksView.java b/src/main/java/com/sparrowwallet/sparrow/control/RecentBlocksView.java index db47bd84..653c2e46 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/RecentBlocksView.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/RecentBlocksView.java @@ -50,7 +50,9 @@ public class RecentBlocksView extends Pane { } })); - updateFeeRatesSource(Config.get().getFeeRatesSource()); + FeeRatesSource feeRatesSource = Config.get().getFeeRatesSource(); + feeRatesSource = (feeRatesSource == null ? FeeRatesSource.MEMPOOL_SPACE : feeRatesSource); + updateFeeRatesSource(feeRatesSource); Tooltip.install(this, tooltip); } @@ -140,8 +142,10 @@ public class RecentBlocksView extends Pane { public void updateFeeRate(Map targetBlockFeeRates) { int defaultTarget = TARGET_BLOCKS_RANGE.get((TARGET_BLOCKS_RANGE.size() / 2) - 1); - Double defaultRate = targetBlockFeeRates.get(defaultTarget); - updateFeeRate(defaultRate); + if(targetBlockFeeRates.get(defaultTarget) != null) { + Double defaultRate = targetBlockFeeRates.get(defaultTarget); + updateFeeRate(defaultRate); + } } public void updateFeeRate(Double currentFeeRate) {