aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-08-02 14:44:19 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-08-02 14:44:19 +0100
commitfa23a5006d20bd8f4a6b177ec999bfca4bc2e42c (patch)
tree1cb78ec02da145d25428d672cbd6c72ff4148489 /src/wallet/wallet2.cpp
parentnode_rpc_proxy: add a proxy for target height (diff)
downloadmonero-fa23a5006d20bd8f4a6b177ec999bfca4bc2e42c.tar.xz
wallet2: add a is_synced function
Diffstat (limited to 'src/wallet/wallet2.cpp')
-rw-r--r--src/wallet/wallet2.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 6b1026a55..bb8cdaf63 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -5667,6 +5667,15 @@ uint64_t wallet2::get_blockchain_height_by_date(uint16_t year, uint8_t month, ui
}
}
//----------------------------------------------------------------------------------------------------
+bool wallet2::is_synced() const
+{
+ uint64_t height;
+ boost::optional<std::string> result = m_node_rpc_proxy.get_target_height(height);
+ if (result && *result != CORE_RPC_STATUS_OK)
+ return false;
+ return get_blockchain_current_height() >= height;
+}
+//----------------------------------------------------------------------------------------------------
void wallet2::generate_genesis(cryptonote::block& b) {
if (m_testnet)
{