MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / getnetworkhashps

Function getnetworkhashps

src/rpc/mining.cpp:90–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88// TODO(h4x3rotab): Implement RPC `getlocalsolps`, and maybe `getnetworksolps` as a alias of `getnetworkhashps`.
89
90static UniValue getnetworkhashps(const JSONRPCRequest& request)
91{
92 if (request.fHelp || request.params.size() > 2)
93 throw std::runtime_error(
94 "getnetworkhashps ( nblocks height )\n"
95 "\nReturns the estimated network hashes per second based on the last n blocks.\n"
96 "Pass in [blocks] to override # of blocks, -1 specifies since last difficulty change.\n"
97 "Pass in [height] to estimate the network speed at the time when a certain block was found.\n"
98 "\nArguments:\n"
99 "1. nblocks (numeric, optional, default=120) The number of blocks, or -1 for blocks since last difficulty change.\n"
100 "2. height (numeric, optional, default=-1) To estimate at the time of the given height.\n"
101 "\nResult:\n"
102 "x (numeric) Hashes per second estimated\n"
103 "\nExamples:\n"
104 + HelpExampleCli("getnetworkhashps", "")
105 + HelpExampleRpc("getnetworkhashps", "")
106 );
107
108 LOCK(cs_main);
109 return GetNetworkHashPS(!request.params[0].isNull() ? request.params[0].get_int() : 120, !request.params[1].isNull() ? request.params[1].get_int() : -1);
110}
111
112UniValue generateBlocks(std::shared_ptr<CReserveScript> coinbaseScript, int nGenerate, uint64_t nMaxTries, bool keepScript)
113{

Callers 1

getmininginfoFunction · 0.85

Calls 6

HelpExampleCliFunction · 0.85
HelpExampleRpcFunction · 0.85
GetNetworkHashPSFunction · 0.85
isNullMethod · 0.80
get_intMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected