aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-01-13 14:35:21 -0500
committerRiccardo Spagni <ric@spagni.net>2017-01-13 14:35:21 -0500
commit0b6031adbfdfe570a1985ae0eabbc056a5545a84 (patch)
tree78776d0da0587f2127e5e52f2214c1c57b6628d5 /src/cryptonote_core
parentMerge pull request #1541 (diff)
parentAdd start_time to get_info methods and show uptime (diff)
downloadmonero-0b6031adbfdfe570a1985ae0eabbc056a5545a84.tar.xz
Merge pull request #1543
19be7225 Add start_time to get_info methods and show uptime (Miguel Herranz)
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r--src/cryptonote_core/cryptonote_core.cpp7
-rw-r--r--src/cryptonote_core/cryptonote_core.h8
2 files changed, 15 insertions, 0 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp
index b2099641f..c63a08ee4 100644
--- a/src/cryptonote_core/cryptonote_core.cpp
+++ b/src/cryptonote_core/cryptonote_core.cpp
@@ -249,6 +249,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);
@@ -995,6 +997,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);
diff --git a/src/cryptonote_core/cryptonote_core.h b/src/cryptonote_core/cryptonote_core.h
index 21f84cdd4..a9e80aeee 100644
--- a/src/cryptonote_core/cryptonote_core.h
+++ b/src/cryptonote_core/cryptonote_core.h
@@ -560,6 +560,12 @@ namespace cryptonote
uint64_t get_target_blockchain_height() const;
/**
+ * @brief gets start_time
+ *
+ */
+ std::time_t get_start_time() const;
+
+ /**
* @brief tells the Blockchain to update its checkpoints
*
* This function will check if enough time has passed since the last
@@ -813,6 +819,8 @@ namespace cryptonote
boost::interprocess::file_lock db_lock; //!< a lock object for a file lock in the db directory
size_t block_sync_size;
+
+ time_t start_time;
};
}