From 49c9bd27b9ee809b039b5f8731f860b750454789 Mon Sep 17 00:00:00 2001 From: woodser Date: Thu, 18 Jul 2019 22:19:40 -0400 Subject: [PATCH] init("") on wallet load; set sync interval --- src/wallet/MoneroWallet.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/wallet/MoneroWallet.cpp b/src/wallet/MoneroWallet.cpp index 261569d..2eacd35 100644 --- a/src/wallet/MoneroWallet.cpp +++ b/src/wallet/MoneroWallet.cpp @@ -77,7 +77,7 @@ namespace monero { // ------------------------- INITIALIZE CONSTANTS --------------------------- - static const int DEFAULT_REFRESH_INTERVAL_MILLIS = 1000 * 10; // default refresh interval 10 sec + static const int DEFAULT_SYNC_INTERVAL_MILLIS = 1000 * 10; // default refresh interval 10 sec static const int DEFAULT_CONNECTION_TIMEOUT_MILLIS = 1000 * 30; // default connection timeout 30 sec // ----------------------- INTERNAL PRIVATE HELPERS ----------------------- @@ -740,6 +740,7 @@ namespace monero { cout << "MoneroWallet(3b)" << endl; wallet2 = unique_ptr(new tools::wallet2(static_cast(networkType), 1, true)); wallet2->load(path, password); + wallet2->init(""); initCommon(); } @@ -1072,7 +1073,7 @@ namespace monero { uint64_t MoneroWallet::getChainHeight() const { string err; - if (getDaemonConnection() == nullptr) throw runtime_error("No connection to daemon"); + if (!isConnected) throw runtime_error("No connection to daemon"); uint64_t chainHeight = wallet2->get_daemon_blockchain_height(err); if (!err.empty()) throw runtime_error(err); return chainHeight; @@ -2298,6 +2299,7 @@ namespace monero { rescanOnSync = false; autoSyncEnabled = false; autoSyncThreadDone = false; + autoSyncInterval = DEFAULT_SYNC_INTERVAL_MILLIS; // start auto sync loop autoSyncThread = boost::thread([this]() { @@ -2328,7 +2330,7 @@ namespace monero { do { if (getIsDaemonSynced()) { if (rescan) wallet2->rescan_blockchain(false); - sync(); + syncAux(boost::none, boost::none, boost::none); if (!isSynced) isSynced = true; wallet2->find_and_save_rings(false); }