| 170 | } |
| 171 | |
| 172 | UniValue getdifficulty(const UniValue& params, bool fHelp) |
| 173 | { |
| 174 | if (fHelp || params.size() != 0) |
| 175 | throw runtime_error( |
| 176 | "getdifficulty\n" |
| 177 | "\nReturns the proof-of-work difficulty as a multiple of the minimum difficulty.\n" |
| 178 | "\nReturns the proof-of-stake difficulty as a multiple of the minimum difficulty.\n" |
| 179 | "\nResult:\n" |
| 180 | "n.nnn (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty.\n" |
| 181 | "\nExamples:\n" + |
| 182 | HelpExampleCli("getdifficulty", "") + HelpExampleRpc("getdifficulty", "")); |
| 183 | |
| 184 | LOCK(cs_main); |
| 185 | UniValue obj(UniValue::VOBJ); |
| 186 | obj.push_back(Pair("proof-of-work", GetDifficulty(GetLastBlockIndex(pindexBestHeader, false)))); |
| 187 | obj.push_back(Pair("proof-of-stake", GetDifficulty(GetLastBlockIndex(pindexBestHeader, true)))); |
| 188 | return obj; |
| 189 | } |
| 190 | |
| 191 | UniValue getrawmempool(const UniValue& params, bool fHelp) |
| 192 | { |
nothing calls this directly
no test coverage detected