mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-07 19:22:17 +01:00
[RPC] Add an uptime command that displays the amount of time that bitcoind has been running
This commit is contained in:
@@ -84,6 +84,8 @@
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/conf.h>
|
||||
|
||||
// Application startup time (used for uptime calculation)
|
||||
const int64_t nStartupTime = GetTime();
|
||||
|
||||
const char * const BITCOIN_CONF_FILENAME = "bitcoin.conf";
|
||||
const char * const BITCOIN_PID_FILENAME = "bitcoind.pid";
|
||||
@@ -889,3 +891,9 @@ std::string CopyrightHolders(const std::string& strPrefix)
|
||||
}
|
||||
return strCopyrightHolders;
|
||||
}
|
||||
|
||||
// Obtain the application startup time (used for uptime calculation)
|
||||
int64_t GetStartupTime()
|
||||
{
|
||||
return nStartupTime;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user