aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorMiguel Herranz <miguel@ipglider.org>2017-01-09 00:50:29 +0100
committerMiguel Herranz <miguel@ipglider.org>2017-01-12 00:15:21 +0100
commit19be7225cccecfd871095a434f185fcb7695cfaa (patch)
tree158e9abfed2184acea473aa718b914c2cb6988eb /src/rpc
parentMerge pull request #1544 (diff)
downloadmonero-19be7225cccecfd871095a434f185fcb7695cfaa.tar.xz
Add start_time to get_info methods and show uptime
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/core_rpc_server.cpp2
-rw-r--r--src/rpc/core_rpc_server_commands_defs.h4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index 6ca01ed2c..fa4b63644 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -145,6 +145,7 @@ namespace cryptonote
res.cumulative_difficulty = m_core.get_blockchain_storage().get_db().get_block_cumulative_difficulty(res.height - 1);
res.block_size_limit = m_core.get_blockchain_storage().get_current_cumulative_blocksize_limit();
res.status = CORE_RPC_STATUS_OK;
+ res.start_time = (uint64_t)m_core.get_start_time();
return true;
}
//------------------------------------------------------------------------------------------------------------------------------
@@ -1165,6 +1166,7 @@ namespace cryptonote
res.cumulative_difficulty = m_core.get_blockchain_storage().get_db().get_block_cumulative_difficulty(res.height - 1);
res.block_size_limit = m_core.get_blockchain_storage().get_current_cumulative_blocksize_limit();
res.status = CORE_RPC_STATUS_OK;
+ res.start_time = (uint64_t)m_core.get_start_time();
return true;
}
//------------------------------------------------------------------------------------------------------------------------------
diff --git a/src/rpc/core_rpc_server_commands_defs.h b/src/rpc/core_rpc_server_commands_defs.h
index c08e43066..d1fadb6a7 100644
--- a/src/rpc/core_rpc_server_commands_defs.h
+++ b/src/rpc/core_rpc_server_commands_defs.h
@@ -49,7 +49,7 @@ namespace cryptonote
// advance which version they will stop working with
// Don't go over 32767 for any of these
#define CORE_RPC_VERSION_MAJOR 1
-#define CORE_RPC_VERSION_MINOR 3
+#define CORE_RPC_VERSION_MINOR 4
#define CORE_RPC_VERSION (((CORE_RPC_VERSION_MAJOR)<<16)|(CORE_RPC_VERSION_MINOR))
struct COMMAND_RPC_GET_HEIGHT
@@ -513,6 +513,7 @@ namespace cryptonote
std::string top_block_hash;
uint64_t cumulative_difficulty;
uint64_t block_size_limit;
+ uint64_t start_time;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(status)
@@ -531,6 +532,7 @@ namespace cryptonote
KV_SERIALIZE(top_block_hash)
KV_SERIALIZE(cumulative_difficulty)
KV_SERIALIZE(block_size_limit)
+ KV_SERIALIZE(start_time)
END_KV_SERIALIZE_MAP()
};
};