show warning when sweeping a private key that contains insufficient funds for the given fee rate

This commit is contained in:
Craig Raw 2024-05-27 09:48:15 +02:00
parent 369983748d
commit afb6037449

View file

@ -407,6 +407,12 @@ public class PrivateKeySweepDialog extends Dialog<Transaction> {
if(total - fee <= dustThreshold) { if(total - fee <= dustThreshold) {
AppServices.showErrorDialog("Insufficient funds", "The unspent outputs for this private key contain insufficient funds to spend (" + total + " sats)."); AppServices.showErrorDialog("Insufficient funds", "The unspent outputs for this private key contain insufficient funds to spend (" + total + " sats).");
return; return;
} else {
Optional<ButtonType> 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;
}
} }
} }