[RPC] Add an uptime command that displays the amount of time that bitcoind has been running

This commit is contained in:
Ricardo Velhote
2017-05-14 19:18:26 +01:00
parent d609fd85ca
commit c07475294a
6 changed files with 63 additions and 3 deletions

View File

@@ -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;
}