Add timeoffset to getinfo RPC call

Provides a method to get the difference between network adjusted time
and local time from the RPC interface.
This commit is contained in:
Peter Todd
2013-01-11 06:11:34 -05:00
parent 429915bd0d
commit 8686f6467c
3 changed files with 8 additions and 1 deletions

View File

@@ -75,6 +75,7 @@ Value getinfo(const Array& params, bool fHelp)
obj.push_back(Pair("walletversion", pwalletMain->GetVersion()));
obj.push_back(Pair("balance", ValueFromAmount(pwalletMain->GetBalance())));
obj.push_back(Pair("blocks", (int)nBestHeight));
obj.push_back(Pair("timeoffset", (boost::int64_t)GetTimeOffset()));
obj.push_back(Pair("connections", (int)vNodes.size()));
obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string())));
obj.push_back(Pair("difficulty", (double)GetDifficulty()));