mirror of
https://github.com/monero-project/monero.git
synced 2025-07-22 04:58:51 -04:00
Merge pull request #1543
19be7225
Add start_time to get_info methods and show uptime (Miguel Herranz)
This commit is contained in:
commit
0b6031adbf
5 changed files with 25 additions and 1 deletions
|
@ -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);
|
||||
|
|
|
@ -559,6 +559,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
|
||||
*
|
||||
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue