mirror of
https://github.com/monero-project/monero.git
synced 2024-12-23 12:09:54 +00:00
wallet2: add a is_synced function
This commit is contained in:
parent
f1307bbd7b
commit
fa23a5006d
2 changed files with 11 additions and 0 deletions
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -597,6 +597,8 @@ namespace tools
|
|||
|
||||
uint64_t get_blockchain_height_by_date(uint16_t year, uint8_t month, uint8_t day); // 1<=month<=12, 1<=day<=31
|
||||
|
||||
bool is_synced() const;
|
||||
|
||||
private:
|
||||
/*!
|
||||
* \brief Stores wallet information to wallet file.
|
||||
|
|
Loading…
Reference in a new issue