aboutsummaryrefslogtreecommitdiff
path: root/src/libwalletqt/Wallet.cpp
diff options
context:
space:
mode:
authorxiphon <xiphon@protonmail.com>2019-06-13 12:19:52 +0000
committerxiphon <xiphon@protonmail.com>2019-06-13 12:33:05 +0000
commit2524cc179e985cd6abfb7cb4b4c7e6a064188cef (patch)
tree9699c1bbe10ec138d85c7907a87a7aa122ce0f3b /src/libwalletqt/Wallet.cpp
parent68c7cf7276b8192ef800e3ab8fcc51815fb9c1cc (diff)
downloadmonzero-gui-2524cc179e985cd6abfb7cb4b4c7e6a064188cef.tar.gz
monzero-gui-2524cc179e985cd6abfb7cb4b4c7e6a064188cef.tar.xz
monzero-gui-2524cc179e985cd6abfb7cb4b4c7e6a064188cef.zip
Wallet: async fetching wallet, daemon and target height
Diffstat (limited to 'src/libwalletqt/Wallet.cpp')
-rw-r--r--src/libwalletqt/Wallet.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libwalletqt/Wallet.cpp b/src/libwalletqt/Wallet.cpp
index 2f106aed..629106da 100644
--- a/src/libwalletqt/Wallet.cpp
+++ b/src/libwalletqt/Wallet.cpp
@@ -348,6 +348,19 @@ void Wallet::setSubaddressLabel(quint32 accountIndex, quint32 addressIndex, cons
m_walletImpl->setSubaddressLabel(accountIndex, addressIndex, label.toStdString());
}
+void Wallet::refreshHeightAsync() const
+{
+ QtConcurrent::run([this] {
+ QFuture<quint64> daemonHeight = QtConcurrent::run([this] {
+ return daemonBlockChainHeight();
+ });
+ QFuture<quint64> targetHeight = QtConcurrent::run([this] {
+ return daemonBlockChainTargetHeight();
+ });
+ emit heightRefreshed(blockChainHeight(), daemonHeight.result(), targetHeight.result());
+ });
+}
+
quint64 Wallet::blockChainHeight() const
{
return m_walletImpl->blockChainHeight();