| 88 | // TODO(h4x3rotab): Implement RPC `getlocalsolps`, and maybe `getnetworksolps` as a alias of `getnetworkhashps`. |
| 89 | |
| 90 | static 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 | |
| 112 | UniValue generateBlocks(std::shared_ptr<CReserveScript> coinbaseScript, int nGenerate, uint64_t nMaxTries, bool keepScript) |
| 113 | { |
no test coverage detected