From afb6037449077f16ca3f952a737f4cde3d48dbd0 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Mon, 27 May 2024 09:48:15 +0200 Subject: [PATCH] show warning when sweeping a private key that contains insufficient funds for the given fee rate --- .../sparrow/control/PrivateKeySweepDialog.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/com/sparrowwallet/sparrow/control/PrivateKeySweepDialog.java b/src/main/java/com/sparrowwallet/sparrow/control/PrivateKeySweepDialog.java index 0b30390b..a613e709 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/PrivateKeySweepDialog.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/PrivateKeySweepDialog.java @@ -407,6 +407,12 @@ public class PrivateKeySweepDialog extends Dialog { if(total - fee <= dustThreshold) { AppServices.showErrorDialog("Insufficient funds", "The unspent outputs for this private key contain insufficient funds to spend (" + total + " sats)."); return; + } else { + Optional optType = AppServices.showWarningDialog("Insufficient funds", "The unspent outputs for this private key contain insufficient funds (" + total + " sats) for a transaction at this fee rate." + + "\n\nContinue with a minimum fee rate transaction?", ButtonType.YES, ButtonType.NO); + if(optType.isPresent() && optType.get() == ButtonType.NO) { + return; + } } }