mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-10 21:04:32 +00:00
store wallet after first successful refresh
This commit is contained in:
parent
a9a279c979
commit
4f3526d995
1 changed files with 10 additions and 0 deletions
10
main.qml
10
main.qml
|
@ -53,6 +53,7 @@ ApplicationWindow {
|
||||||
property var transaction;
|
property var transaction;
|
||||||
property alias password : passwordDialog.password
|
property alias password : passwordDialog.password
|
||||||
property int splashCounter: 0
|
property int splashCounter: 0
|
||||||
|
property bool isNewWallet: false
|
||||||
|
|
||||||
function altKeyReleased() { ctrlPressed = false; }
|
function altKeyReleased() { ctrlPressed = false; }
|
||||||
|
|
||||||
|
@ -141,6 +142,7 @@ ApplicationWindow {
|
||||||
// wallet already opened with wizard, we just need to initialize it
|
// wallet already opened with wizard, we just need to initialize it
|
||||||
if (typeof wizard.settings['wallet'] !== 'undefined') {
|
if (typeof wizard.settings['wallet'] !== 'undefined') {
|
||||||
connectWallet(wizard.settings['wallet'])
|
connectWallet(wizard.settings['wallet'])
|
||||||
|
isNewWallet = true
|
||||||
} else {
|
} else {
|
||||||
var wallet_path = walletPath();
|
var wallet_path = walletPath();
|
||||||
// console.log("opening wallet at: ", wallet_path, "with password: ", appWindow.password);
|
// console.log("opening wallet at: ", wallet_path, "with password: ", appWindow.password);
|
||||||
|
@ -219,6 +221,14 @@ ApplicationWindow {
|
||||||
hideProcessingSplash()
|
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
|
leftPanel.networkStatus.connected = currentWallet.connected
|
||||||
onWalletUpdate();
|
onWalletUpdate();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue