aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/api
diff options
context:
space:
mode:
authorJacob Brydolf <jacob@brydolf.net>2016-10-03 20:47:41 +0200
committerJacob Brydolf <jacob@brydolf.net>2016-10-03 20:47:41 +0200
commit65ea8364f894929be24e5753388296f14d9704c8 (patch)
tree5518fdd227ae281c83fa28268bbec85a3038ed4e /src/wallet/api
parentMerge pull request #1124 (diff)
downloadmonero-65ea8364f894929be24e5753388296f14d9704c8.tar.xz
wallet2_api: added Wallet::daemonBlockChainTargetHeight()
libwallet_api: Wallet::blockChainTargetHeight Signed-off-by: Jacob Brydolf <jacob@brydolf.net>
Diffstat (limited to 'src/wallet/api')
-rw-r--r--src/wallet/api/wallet.cpp17
-rw-r--r--src/wallet/api/wallet.h1
2 files changed, 18 insertions, 0 deletions
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();
diff --git a/src/wallet/api/wallet.h b/src/wallet/api/wallet.h
index d97a8f3b3..3d27fbc4d 100644
--- a/src/wallet/api/wallet.h
+++ b/src/wallet/api/wallet.h
@@ -77,6 +77,7 @@ public:
uint64_t unlockedBalance() const;
uint64_t blockChainHeight() const;
uint64_t daemonBlockChainHeight() const;
+ uint64_t daemonBlockChainTargetHeight() const;
bool refresh();
void refreshAsync();
void setAutoRefreshInterval(int millis);