continue recovering from seed on open if not finished

This commit is contained in:
Jacob Brydolf 2016-10-10 21:40:58 +02:00
parent 625ae77945
commit a88c031510
No known key found for this signature in database
GPG key ID: DE46246550D2F3C5

View file

@ -158,7 +158,6 @@ ApplicationWindow {
} }
console.log("using wizard wallet") console.log("using wizard wallet")
connectWallet(wizard.settings['wallet']) connectWallet(wizard.settings['wallet'])
isNewWallet = true isNewWallet = true
@ -183,7 +182,9 @@ ApplicationWindow {
currentWallet.moneySpent.connect(onWalletMoneySent) currentWallet.moneySpent.connect(onWalletMoneySent)
currentWallet.moneyReceived.connect(onWalletMoneyReceived) currentWallet.moneyReceived.connect(onWalletMoneyReceived)
console.log("initializing with daemon address: ", persistentSettings.daemon_address) 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() { function walletPath() {
@ -244,7 +245,6 @@ ApplicationWindow {
leftPanel.daemonProgress.updateProgress(dCurrentBlock,dTargetBlock); leftPanel.daemonProgress.updateProgress(dCurrentBlock,dTargetBlock);
// Store wallet after first refresh. To prevent broken wallet after a crash // Store wallet after first refresh. To prevent broken wallet after a crash
// TODO: Move this to libwallet?
if(isNewWallet && currentWallet.blockChainHeight() > 0){ if(isNewWallet && currentWallet.blockChainHeight() > 0){
currentWallet.store(persistentSettings.wallet_path) currentWallet.store(persistentSettings.wallet_path)
isNewWallet = false isNewWallet = false
@ -257,6 +257,11 @@ ApplicationWindow {
walletInitialized = true walletInitialized = true
} }
// recovering from seed is finished after first refresh
if(persistentSettings.is_recovering) {
persistentSettings.is_recovering = false
}
leftPanel.networkStatus.connected = currentWallet.connected leftPanel.networkStatus.connected = currentWallet.connected
onWalletUpdate(); onWalletUpdate();
@ -445,7 +450,8 @@ ApplicationWindow {
property bool testnet: true property bool testnet: true
property string daemon_address: "localhost:38081" property string daemon_address: "localhost:38081"
property string payment_id property string payment_id
property int restore_height:0 property int restore_height : 0
property bool is_recovering : false
} }
// TODO: replace with customized popups // TODO: replace with customized popups