Skip to content

Commit

Permalink
adding getadjustedtime
Browse files Browse the repository at this point in the history
  • Loading branch information
StealthSend committed Jan 23, 2018
1 parent dd0e517 commit f843c2f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/bitcoinrpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
1 change: 1 addition & 0 deletions src/bitcoinrpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ extern std::vector<unsigned char> 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);
Expand Down
10 changes: 10 additions & 0 deletions src/rpcnet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<CNodeStats>& vstats)
{
vstats.clear();
Expand Down

0 comments on commit f843c2f

Please sign in to comment.