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

Function getnetworkhashps

src/rpcmining.cpp:74–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

getmininginfoFunction · 0.85

Calls 5

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

Tested by

no test coverage detected