From a88c031510d1c572dd2556467898b71356f91a2f Mon Sep 17 00:00:00 2001 From: Jacob Brydolf Date: Mon, 10 Oct 2016 21:40:58 +0200 Subject: [PATCH] continue recovering from seed on open if not finished --- main.qml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/main.qml b/main.qml index bba92f88..f90944f8 100644 --- a/main.qml +++ b/main.qml @@ -158,7 +158,6 @@ ApplicationWindow { } console.log("using wizard wallet") - connectWallet(wizard.settings['wallet']) isNewWallet = true @@ -183,7 +182,9 @@ ApplicationWindow { currentWallet.moneySpent.connect(onWalletMoneySent) currentWallet.moneyReceived.connect(onWalletMoneyReceived) console.log("initializing with daemon address: ", persistentSettings.daemon_address) - currentWallet.initAsync(persistentSettings.daemon_address, 0); + console.log("Recovering from seed: ", persistentSettings.is_recovering) + console.log("restore Height", persistentSettings.restore_height) + currentWallet.initAsync(persistentSettings.daemon_address, 0, persistentSettings.is_recovering, persistentSettings.restore_height); } function walletPath() { @@ -244,7 +245,6 @@ ApplicationWindow { leftPanel.daemonProgress.updateProgress(dCurrentBlock,dTargetBlock); // Store wallet after first refresh. To prevent broken wallet after a crash - // TODO: Move this to libwallet? if(isNewWallet && currentWallet.blockChainHeight() > 0){ currentWallet.store(persistentSettings.wallet_path) isNewWallet = false @@ -257,6 +257,11 @@ ApplicationWindow { walletInitialized = true } + // recovering from seed is finished after first refresh + if(persistentSettings.is_recovering) { + persistentSettings.is_recovering = false + } + leftPanel.networkStatus.connected = currentWallet.connected onWalletUpdate(); @@ -445,7 +450,8 @@ ApplicationWindow { property bool testnet: true property string daemon_address: "localhost:38081" property string payment_id - property int restore_height:0 + property int restore_height : 0 + property bool is_recovering : false } // TODO: replace with customized popups