show custom error dialog for min relay fee not met broadcast errors

This commit is contained in:
Craig Raw 2022-07-11 17:07:12 +02:00
parent f8fce02a3d
commit 91273c2192

View File

@ -1107,7 +1107,14 @@ public class HeadersController extends TransactionFormController implements Init
broadcastTransactionService.setOnFailed(workerStateEvent -> {
broadcastProgressBar.setProgress(0);
log.error("Error broadcasting transaction", workerStateEvent.getSource().getException());
AppServices.showErrorDialog("Error broadcasting transaction", "The server returned an error when broadcasting the transaction. The server response is contained in the log (See Help > Show Log File).");
if(workerStateEvent.getSource().getException() != null && workerStateEvent.getSource().getException().getMessage() != null
&& workerStateEvent.getSource().getException().getMessage().startsWith("min relay fee not met")) {
AppServices.showErrorDialog("Error broadcasting transaction", "The fee rate for the signed transaction is below the minimum " + AppServices.getMinimumRelayFeeRate() + " sats/vB. " +
"This usually happens because a keystore has created a signature that is larger than necessary.\n\n" +
"You can solve this by recreating the transaction with a slightly increased fee rate.");
} else {
AppServices.showErrorDialog("Error broadcasting transaction", "The server returned an error when broadcasting the transaction. The server response is contained in the log (See Help > Show Log File).");
}
broadcastButton.setDisable(false);
});