From 65ea8364f894929be24e5753388296f14d9704c8 Mon Sep 17 00:00:00 2001 From: Jacob Brydolf Date: Mon, 3 Oct 2016 20:47:41 +0200 Subject: wallet2_api: added Wallet::daemonBlockChainTargetHeight() libwallet_api: Wallet::blockChainTargetHeight Signed-off-by: Jacob Brydolf --- src/wallet/api/wallet.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/wallet/api/wallet.cpp') diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp index eefb49e95..5afad15c7 100644 --- a/src/wallet/api/wallet.cpp +++ b/src/wallet/api/wallet.cpp @@ -441,6 +441,23 @@ uint64_t WalletImpl::daemonBlockChainHeight() const return result; } +uint64_t WalletImpl::daemonBlockChainTargetHeight() const +{ + std::string err; + uint64_t result = m_wallet->get_daemon_blockchain_target_height(err); + if (!err.empty()) { + LOG_ERROR(__FUNCTION__ << ": " << err); + result = 0; + m_errorString = err; + m_status = Status_Error; + + } else { + m_status = Status_Ok; + m_errorString = ""; + } + return result; +} + bool WalletImpl::refresh() { clearStatus(); -- cgit v1.2.3