Wallet: async fetching wallet, daemon and target height

This commit is contained in:
xiphon
2019-06-13 12:19:52 +00:00
parent 68c7cf7276
commit 2524cc179e
3 changed files with 38 additions and 21 deletions

View File

@@ -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();