forked from Public/monero-gui
Merge pull request #143
4e61ebeadd default argument to store() (Jacob Brydolf)7c9d223remove unnecessary i/o (Jacob Brydolf)
This commit is contained in:
17
main.qml
17
main.qml
@@ -289,13 +289,16 @@ ApplicationWindow {
|
|||||||
daemonSynced = (currentWallet.connected != Wallet.ConnectionStatus_Disconnected && dCurrentBlock >= dTargetBlock)
|
daemonSynced = (currentWallet.connected != Wallet.ConnectionStatus_Disconnected && dCurrentBlock >= dTargetBlock)
|
||||||
|
|
||||||
|
|
||||||
|
// Refresh is succesfull if blockchain height > 1
|
||||||
// Store wallet after every refresh.
|
|
||||||
if (currentWallet.blockChainHeight() > 1){
|
if (currentWallet.blockChainHeight() > 1){
|
||||||
|
|
||||||
//TODO: Doesn't need path after creation. Change libwalletqt
|
// Save new wallet after first refresh
|
||||||
currentWallet.store("")
|
// Wallet is nomrmally saved to disk on app exit. This prevents rescan from block 0 after app crash
|
||||||
console.log("Saving wallet");
|
if(isNewWallet){
|
||||||
|
console.log("Saving wallet after first refresh");
|
||||||
|
currentWallet.store()
|
||||||
|
isNewWallet = false
|
||||||
|
}
|
||||||
|
|
||||||
// recovering from seed is finished after first refresh
|
// recovering from seed is finished after first refresh
|
||||||
if(persistentSettings.is_recovering) {
|
if(persistentSettings.is_recovering) {
|
||||||
@@ -303,7 +306,6 @@ ApplicationWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
isNewWallet = false
|
|
||||||
|
|
||||||
// initialize transaction history once wallet is initializef first time;
|
// initialize transaction history once wallet is initializef first time;
|
||||||
if (!walletInitialized) {
|
if (!walletInitialized) {
|
||||||
@@ -978,6 +980,7 @@ ApplicationWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
onClosing: {
|
onClosing: {
|
||||||
//walletManager.closeWallet(currentWallet);
|
// Close and save to disk on app close
|
||||||
|
walletManager.closeWallet(currentWallet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,7 +79,8 @@ public:
|
|||||||
QString address() const;
|
QString address() const;
|
||||||
|
|
||||||
//! saves wallet to the file by given path
|
//! 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
|
//! initializes wallet
|
||||||
Q_INVOKABLE bool init(const QString &daemonAddress, quint64 upperTransactionLimit, bool isRecovering = false, quint64 restoreHeight = 0);
|
Q_INVOKABLE bool init(const QString &daemonAddress, quint64 upperTransactionLimit, bool isRecovering = false, quint64 restoreHeight = 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user