aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
authorRicardo Velhote <rvelhote@gmail.com>2017-05-14 19:18:26 +0100
committerRicardo Velhote <rvelhote@gmail.com>2017-06-25 20:25:45 +0100
commitc07475294ae2c60f1dcc394922838b1f1f57b476 (patch)
treec319c0083959385a694e7b30ea7f00422c5c82b1 /src/util.cpp
parentd609fd85ca41c003233d74fbd6c680970ad4a48b (diff)
downloadbitcoin-c07475294ae2c60f1dcc394922838b1f1f57b476.tar.xz
[RPC] Add an uptime command that displays the amount of time that bitcoind has been running
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 20a8082017..0e1464e590 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -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;
+}