diff --git a/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/MixPoolDialog.java b/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/MixPoolDialog.java index 74cb45d7..4cd31961 100644 --- a/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/MixPoolDialog.java +++ b/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/MixPoolDialog.java @@ -197,6 +197,7 @@ public class MixPoolDialog extends WalletDialog { tx0Previews = null; whirlpool.setScode(mixConfig.getScode()); whirlpool.setTx0FeeTarget(tx0FeeTarget); + whirlpool.setMixFeeTarget(tx0FeeTarget); Whirlpool.Tx0PreviewsService tx0PreviewsService = new Whirlpool.Tx0PreviewsService(whirlpool, utxoEntries); tx0PreviewsService.setOnRunning(workerStateEvent -> { diff --git a/src/main/java/com/sparrowwallet/sparrow/whirlpool/WhirlpoolController.java b/src/main/java/com/sparrowwallet/sparrow/whirlpool/WhirlpoolController.java index 5d2f88bc..30c2bc42 100644 --- a/src/main/java/com/sparrowwallet/sparrow/whirlpool/WhirlpoolController.java +++ b/src/main/java/com/sparrowwallet/sparrow/whirlpool/WhirlpoolController.java @@ -55,6 +55,9 @@ public class WhirlpoolController { @FXML private CopyableLabel premixFeeRate; + @FXML + private Label lowPremixFeeRate; + @FXML private ComboBox pool; @@ -139,9 +142,12 @@ public class WhirlpoolController { tx0Previews = null; tx0PreviewProperty.set(null); Tx0FeeTarget tx0FeeTarget = FEE_TARGETS.get(newValue.intValue()); - premixFeeRate.setText(SparrowMinerFeeSupplier.getFee(Integer.parseInt(tx0FeeTarget.getFeeTarget().getValue())) + " sats/vB"); + premixFeeRate.setText(getFeeRate(tx0FeeTarget) + " sats/vB"); + lowPremixFeeRate.setVisible(tx0FeeTarget == Tx0FeeTarget.MIN && getFeeRate(tx0FeeTarget) * 2 < getFeeRate(Tx0FeeTarget.BLOCKS_4)); }); premixPriority.setValue(1); + lowPremixFeeRate.managedProperty().bind(lowPremixFeeRate.visibleProperty()); + lowPremixFeeRate.setVisible(false); if(mixConfig.getScode() != null) { step1.setVisible(false); @@ -218,6 +224,10 @@ public class WhirlpoolController { }); } + private int getFeeRate(Tx0FeeTarget tx0FeeTarget) { + return SparrowMinerFeeSupplier.getFee(Integer.parseInt(tx0FeeTarget.getFeeTarget().getValue())); + } + public boolean next() { if(step1.isVisible()) { step1.setVisible(false); @@ -318,6 +328,7 @@ public class WhirlpoolController { tx0Previews = null; whirlpool.setScode(mixConfig.getScode()); whirlpool.setTx0FeeTarget(FEE_TARGETS.get(premixPriority.valueProperty().intValue())); + whirlpool.setMixFeeTarget(FEE_TARGETS.get(premixPriority.valueProperty().intValue())); Whirlpool.Tx0PreviewsService tx0PreviewsService = new Whirlpool.Tx0PreviewsService(whirlpool, utxoEntries); tx0PreviewsService.setOnRunning(workerStateEvent -> { diff --git a/src/main/resources/com/sparrowwallet/sparrow/whirlpool/whirlpool.css b/src/main/resources/com/sparrowwallet/sparrow/whirlpool/whirlpool.css index 2cfd0f9b..36a4da28 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/whirlpool/whirlpool.css +++ b/src/main/resources/com/sparrowwallet/sparrow/whirlpool/whirlpool.css @@ -43,4 +43,8 @@ .field-control { -fx-pref-width: 180px; -} \ No newline at end of file +} + +.low-fee-warning { + -fx-text-fill: rgb(238, 210, 2); +} diff --git a/src/main/resources/com/sparrowwallet/sparrow/whirlpool/whirlpool.fxml b/src/main/resources/com/sparrowwallet/sparrow/whirlpool/whirlpool.fxml index 510765c1..629bc1ac 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/whirlpool/whirlpool.fxml +++ b/src/main/resources/com/sparrowwallet/sparrow/whirlpool/whirlpool.fxml @@ -107,6 +107,17 @@