Skip to content

Commit

Permalink
store wallet after first successful refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaqueeee committed Oct 5, 2016
1 parent a9a279c commit 4f3526d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ ApplicationWindow {
property var transaction;
property alias password : passwordDialog.password
property int splashCounter: 0
property bool isNewWallet: false

function altKeyReleased() { ctrlPressed = false; }

Expand Down Expand Up @@ -141,6 +142,7 @@ ApplicationWindow {
// wallet already opened with wizard, we just need to initialize it
if (typeof wizard.settings['wallet'] !== 'undefined') {
connectWallet(wizard.settings['wallet'])
isNewWallet = true
} else {
var wallet_path = walletPath();
// console.log("opening wallet at: ", wallet_path, "with password: ", appWindow.password);
Expand Down Expand Up @@ -219,6 +221,14 @@ ApplicationWindow {
hideProcessingSplash()
}

// 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
console.log("wallet stored after first successfull refresh")
}

leftPanel.networkStatus.connected = currentWallet.connected
onWalletUpdate();
}
Expand Down

0 comments on commit 4f3526d

Please sign in to comment.