X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Frpcnet.cpp;h=f2fb213b3401d8638f972e61fb68f9e2d03d8c9b;hp=ecc4331d0a26b8706765dc6a841fc7aaf9ee8bff;hb=a01b68db4ffd37a770b42fdd50080f5ce1b15732;hpb=e5bad7e0ce0055de912222776edfae9059c6e3c7 diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index ecc4331..f2fb213 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -137,3 +137,18 @@ Value sendalert(const Array& params, bool fHelp) result.push_back(Pair("nCancel", alert.nCancel)); return result; } + +Value getnettotals(const Array& params, bool fHelp) +{ + if (fHelp || params.size() > 0) + throw runtime_error( + "getnettotals\n" + "Returns information about network traffic, including bytes in, bytes out,\n" + "and current time."); + + Object obj; + obj.push_back(Pair("totalbytesrecv", static_cast< boost::uint64_t>(CNode::GetTotalBytesRecv()))); + obj.push_back(Pair("totalbytessent", static_cast(CNode::GetTotalBytesSent()))); + obj.push_back(Pair("timemillis", static_cast(GetTimeMillis()))); + return obj; +} \ No newline at end of file