| 81 | } |
| 82 | |
| 83 | UniValue 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 |
| 105 | UniValue getgenerate(const UniValue& params, bool fHelp) |
no test coverage detected