diff options
author | Riccardo Spagni <ric@spagni.net> | 2017-08-15 20:46:31 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2017-08-15 20:46:31 +0200 |
commit | 6f60613ffb345e3af25b0ddf70499d015379e11c (patch) | |
tree | d6b69c6e1b09275af71b4290f6077e9eb89d313a /src/wallet/wallet2.cpp | |
parent | Merge pull request #2238 (diff) | |
parent | simplewallet: add (out of sync) or (no daemon) markers in the prompt (diff) | |
download | monero-6f60613ffb345e3af25b0ddf70499d015379e11c.tar.xz |
Merge pull request #2240
b7d6ec83 simplewallet: add (out of sync) or (no daemon) markers in the prompt (moneromooo-monero)
fa23a500 wallet2: add a is_synced function (moneromooo-monero)
f1307bbd node_rpc_proxy: add a proxy for target height (moneromooo-monero)
Diffstat (limited to 'src/wallet/wallet2.cpp')
-rw-r--r-- | src/wallet/wallet2.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index dfd45ce96..51c772d29 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -5711,6 +5711,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) { |