Merge pull request #143

4e61ebe add default argument to store() (Jacob Brydolf)
7c9d223 remove unnecessary i/o (Jacob Brydolf)
pull/2/head
Riccardo Spagni 8 years ago
commit 75608f1772
No known key found for this signature in database
GPG Key ID: 55432DF31CCD4FCD

@ -289,13 +289,16 @@ ApplicationWindow {
daemonSynced = (currentWallet.connected != Wallet.ConnectionStatus_Disconnected && dCurrentBlock >= dTargetBlock)
// Store wallet after every refresh.
// Refresh is succesfull if blockchain height > 1
if (currentWallet.blockChainHeight() > 1){
//TODO: Doesn't need path after creation. Change libwalletqt
currentWallet.store("")
console.log("Saving wallet");
// Save new wallet after first refresh
// Wallet is nomrmally saved to disk on app exit. This prevents rescan from block 0 after app crash
if(isNewWallet){
console.log("Saving wallet after first refresh");
currentWallet.store()
isNewWallet = false
}
// recovering from seed is finished after first refresh
if(persistentSettings.is_recovering) {
@ -303,7 +306,6 @@ ApplicationWindow {
}
}
isNewWallet = false
// initialize transaction history once wallet is initializef first time;
if (!walletInitialized) {
@ -978,6 +980,7 @@ ApplicationWindow {
}
}
onClosing: {
//walletManager.closeWallet(currentWallet);
// Close and save to disk on app close
walletManager.closeWallet(currentWallet);
}
}

@ -79,7 +79,8 @@ public:
QString address() const;
//! saves wallet to the file by given path
Q_INVOKABLE bool store(const QString &path);
//! empty path stores in current location
Q_INVOKABLE bool store(const QString &path = "");
//! initializes wallet
Q_INVOKABLE bool init(const QString &daemonAddress, quint64 upperTransactionLimit, bool isRecovering = false, quint64 restoreHeight = 0);