aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Brydolf <jacob@brydolf.net>2016-10-05 22:34:47 +0200
committerJacob Brydolf <jacob@brydolf.net>2016-10-05 23:24:40 +0200
commit4f3526d995bdeca0ddcda41e78efde7818decf04 (patch)
tree94317c7536a3397f7bae2358ebdc7dd92552707d
parenta9a279c9796bfecb1263cf7eafc903acb8f20e8f (diff)
downloadmonzero-gui-4f3526d995bdeca0ddcda41e78efde7818decf04.tar.gz
monzero-gui-4f3526d995bdeca0ddcda41e78efde7818decf04.tar.xz
monzero-gui-4f3526d995bdeca0ddcda41e78efde7818decf04.zip
store wallet after first successful refresh
-rw-r--r--main.qml10
1 files changed, 10 insertions, 0 deletions
diff --git a/main.qml b/main.qml
index 0e198084..d6706d5d 100644
--- a/main.qml
+++ b/main.qml
@@ -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; }
@@ -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);
@@ -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();
}