From f843c2f34e2f71e9bbb7fbc1657e910b23212ef3 Mon Sep 17 00:00:00 2001 From: StealthSend Date: Tue, 23 Jan 2018 02:27:51 -0800 Subject: [PATCH] adding getadjustedtime --- src/bitcoinrpc.cpp | 1 + src/bitcoinrpc.h | 1 + src/rpcnet.cpp | 10 ++++++++++ 3 files changed, 12 insertions(+) diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 57042d5..68cf713 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -242,6 +242,7 @@ static const CRPCCommand vRPCCommands[] = { "getbestblockhash", &getbestblockhash, true, false }, { "getblockcount", &getblockcount, true, false }, { "getconnectioncount", &getconnectioncount, true, false }, + { "getadjustedtime", &getadjustedtime, true, false }, { "getpeerinfo", &getpeerinfo, true, false }, { "getdifficulty", &getdifficulty, true, false }, { "getgenerate", &getgenerate, true, false }, diff --git a/src/bitcoinrpc.h b/src/bitcoinrpc.h index 23bc7c5..37caac4 100644 --- a/src/bitcoinrpc.h +++ b/src/bitcoinrpc.h @@ -140,6 +140,7 @@ extern std::vector ParseHexO(const json_spirit::Object& o, std::s extern json_spirit::Value getconnectioncount(const json_spirit::Array& params, bool fHelp); // in rpcnet.cpp +extern json_spirit::Value getadjustedtime(const json_spirit::Array& params, bool fHelp); // in rpcnet.cpp extern json_spirit::Value getpeerinfo(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value dumpprivkey(const json_spirit::Array& params, bool fHelp); // in rpcdump.cpp extern json_spirit::Value importprivkey(const json_spirit::Array& params, bool fHelp); diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index ff20684..1fb7980 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -23,6 +23,16 @@ Value getconnectioncount(const Array& params, bool fHelp) return (int)vNodes.size(); } +Value getadjustedtime(const Array& params, bool fHelp) +{ + if (fHelp || params.size() != 0) + throw runtime_error( + "getadjustedtime\n" + "Returns the StealthCoin network adjusted time."); + + return (boost::int64_t)GetAdjustedTime(); +} + static void CopyNodeStats(std::vector& vstats) { vstats.clear();