MCPcopy Create free account
hub / github.com/LUX-Core/lux / getnetworkhashps

Function getnetworkhashps

src/rpcmining.cpp:83–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83UniValue getnetworkhashps(const UniValue& params, bool fHelp)
84{
85 if (fHelp || params.size() > 2)
86 throw runtime_error(
87 "getnetworkhashps ( blocks height )\n"
88 "\nReturns the estimated network hashes per second based on the last n blocks.\n"
89 "Pass in [blocks] to override # of blocks, -1 specifies since last difficulty change.\n"
90 "Pass in [height] to estimate the network speed at the time when a certain block was found.\n"
91 "\nArguments:\n"
92 "1. blocks (numeric, optional, default=120) The number of blocks, or -1 for blocks since last difficulty change.\n"
93 "2. height (numeric, optional, default=-1) To estimate at the time of the given height.\n"
94 "\nResult:\n"
95 "x (numeric) Hashes per second estimated\n"
96 "\nExamples:\n" +
97 HelpExampleCli("getnetworkhashps", "") + HelpExampleRpc("getnetworkhashps", ""));
98
99 LOCK(cs_main);
100
101 return GetNetworkHashPS(params.size() > 0 ? params[0].get_int() : 120, params.size() > 1 ? params[1].get_int() : -1);
102}
103
104#ifdef ENABLE_WALLET
105UniValue getgenerate(const UniValue& params, bool fHelp)

Callers 1

getmininginfoFunction · 0.85

Calls 5

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

Tested by

no test coverage detected