From c439d6814b29d8cdb7bdc88be563d85161da208d Mon Sep 17 00:00:00 2001 From: xiphon Date: Mon, 4 May 2020 14:48:56 +0000 Subject: [PATCH] main: fix local node status check on closing uninitialized wallet --- main.qml | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/main.qml b/main.qml index 5c7b62c9..b09e0bba 100644 --- a/main.qml +++ b/main.qml @@ -1951,14 +1951,26 @@ ApplicationWindow { } // If daemon is running - prompt user before exiting - if(typeof daemonManager != "undefined" && daemonRunning) { - if (appWindow.walletMode == 0) { - stopDaemon(closeAccepted); - } else { - showDaemonIsRunningDialog(closeAccepted); - } - } else { + if(daemonManager == undefined || persistentSettings.useRemoteNode) { closeAccepted(); + } else if (appWindow.walletMode == 0) { + stopDaemon(closeAccepted); + } else { + showProcessingSplash(qsTr("Checking local node status...")); + const handler = function(running) { + hideProcessingSplash(); + if (running) { + showDaemonIsRunningDialog(closeAccepted); + } else { + closeAccepted(); + } + }; + + if (currentWallet) { + handler(!currentWallet.disconnected); + } else { + daemonManager.runningAsync(persistentSettings.nettype, handler); + } } }