From 19be7225cccecfd871095a434f185fcb7695cfaa Mon Sep 17 00:00:00 2001 From: Miguel Herranz Date: Mon, 9 Jan 2017 00:50:29 +0100 Subject: Add start_time to get_info methods and show uptime --- src/cryptonote_core/cryptonote_core.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/cryptonote_core/cryptonote_core.cpp') diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index 4010d3d44..96bf28e38 100644 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -250,6 +250,8 @@ namespace cryptonote //----------------------------------------------------------------------------------------------- bool core::init(const boost::program_options::variables_map& vm, const cryptonote::test_options *test_options) { + start_time = std::time(nullptr); + m_fakechain = test_options != NULL; bool r = handle_command_line(vm); @@ -1010,6 +1012,11 @@ namespace cryptonote return m_target_blockchain_height; } //----------------------------------------------------------------------------------------------- + std::time_t core::get_start_time() const + { + return start_time; + } + //----------------------------------------------------------------------------------------------- void core::graceful_exit() { raise(SIGTERM); -- cgit v1.2.3