From 8553771f897751be47db092bbb7739b4bc2f625a Mon Sep 17 00:00:00 2001 From: Jaquee Date: Sun, 6 Aug 2017 16:47:11 +0200 Subject: [PATCH] add localDaemonSynced() --- src/libwalletqt/WalletManager.cpp | 5 +++++ src/libwalletqt/WalletManager.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/libwalletqt/WalletManager.cpp b/src/libwalletqt/WalletManager.cpp index 396274c6..a8346478 100644 --- a/src/libwalletqt/WalletManager.cpp +++ b/src/libwalletqt/WalletManager.cpp @@ -275,6 +275,11 @@ bool WalletManager::stopMining() return m_pimpl->stopMining(); } +bool WalletManager::localDaemonSynced() const +{ + return blockchainHeight() > 1 && blockchainHeight() >= blockchainTargetHeight(); +} + QString WalletManager::resolveOpenAlias(const QString &address) const { bool dnssec_valid = false; diff --git a/src/libwalletqt/WalletManager.h b/src/libwalletqt/WalletManager.h index bf9bf19a..69c63b05 100644 --- a/src/libwalletqt/WalletManager.h +++ b/src/libwalletqt/WalletManager.h @@ -112,6 +112,7 @@ public: Q_INVOKABLE quint64 blockchainHeight() const; Q_INVOKABLE quint64 blockchainTargetHeight() const; Q_INVOKABLE double miningHashRate() const; + Q_INVOKABLE bool localDaemonSynced() const; Q_INVOKABLE bool isMining() const; Q_INVOKABLE bool startMining(const QString &address, quint32 threads, bool backgroundMining, bool ignoreBattery);