diff --git a/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java b/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java index 362f1292..b41083c8 100644 --- a/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java +++ b/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java @@ -815,6 +815,7 @@ public class HeadersController extends TransactionFormController implements Init transactionMempoolService = new ElectrumServer.TransactionMempoolService(headersForm.getSigningWallet(), headersForm.getTransaction().getTxId(), headersForm.getSigningWalletNodes()); transactionMempoolService.setDelay(Duration.seconds(3)); transactionMempoolService.setPeriod(Duration.seconds(10)); + transactionMempoolService.setRestartOnFailure(false); transactionMempoolService.setOnSucceeded(mempoolWorkerStateEvent -> { Set scriptHashes = transactionMempoolService.getValue(); if(!scriptHashes.isEmpty()) { @@ -829,6 +830,13 @@ public class HeadersController extends TransactionFormController implements Init broadcastButton.setDisable(false); } }); + transactionMempoolService.setOnFailed(mempoolWorkerStateEvent -> { + transactionMempoolService.cancel(); + broadcastProgressBar.setProgress(0); + log.error("Timeout searching for broadcasted transaction"); + AppServices.showErrorDialog("Timeout searching for broadcasted transaction", "The transaction was broadcast but the server did not indicate it had entered the mempool. It is safe to try broadcasting again."); + broadcastButton.setDisable(false); + }); transactionMempoolService.start(); } else { Sha256Hash txid = headersForm.getTransaction().getTxId();