rpc: get_info - add 'synchronized' field

This commit is contained in:
xiphon 2020-11-19 12:51:31 +00:00
parent 83f1d863bd
commit 0363476ee3
2 changed files with 4 additions and 1 deletions

View File

@ -486,6 +486,7 @@ namespace cryptonote
res.database_size = round_up(res.database_size, 5ull* 1024 * 1024 * 1024); res.database_size = round_up(res.database_size, 5ull* 1024 * 1024 * 1024);
res.update_available = restricted ? false : m_core.is_update_available(); res.update_available = restricted ? false : m_core.is_update_available();
res.version = restricted ? "" : MONERO_VERSION_FULL; res.version = restricted ? "" : MONERO_VERSION_FULL;
res.synchronized = check_core_ready();
res.status = CORE_RPC_STATUS_OK; res.status = CORE_RPC_STATUS_OK;
return true; return true;

View File

@ -88,7 +88,7 @@ namespace cryptonote
// advance which version they will stop working with // advance which version they will stop working with
// Don't go over 32767 for any of these // Don't go over 32767 for any of these
#define CORE_RPC_VERSION_MAJOR 3 #define CORE_RPC_VERSION_MAJOR 3
#define CORE_RPC_VERSION_MINOR 2 #define CORE_RPC_VERSION_MINOR 3
#define MAKE_CORE_RPC_VERSION(major,minor) (((major)<<16)|(minor)) #define MAKE_CORE_RPC_VERSION(major,minor) (((major)<<16)|(minor))
#define CORE_RPC_VERSION MAKE_CORE_RPC_VERSION(CORE_RPC_VERSION_MAJOR, CORE_RPC_VERSION_MINOR) #define CORE_RPC_VERSION MAKE_CORE_RPC_VERSION(CORE_RPC_VERSION_MAJOR, CORE_RPC_VERSION_MINOR)
@ -685,6 +685,7 @@ namespace cryptonote
uint64_t database_size; uint64_t database_size;
bool update_available; bool update_available;
std::string version; std::string version;
bool synchronized;
BEGIN_KV_SERIALIZE_MAP() BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE_PARENT(rpc_access_response_base) KV_SERIALIZE_PARENT(rpc_access_response_base)
@ -724,6 +725,7 @@ namespace cryptonote
KV_SERIALIZE(database_size) KV_SERIALIZE(database_size)
KV_SERIALIZE(update_available) KV_SERIALIZE(update_available)
KV_SERIALIZE(version) KV_SERIALIZE(version)
KV_SERIALIZE(synchronized)
END_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP()
}; };
typedef epee::misc_utils::struct_init<response_t> response; typedef epee::misc_utils::struct_init<response_t> response;