| 501 | } |
| 502 | |
| 503 | static RPCMethod getdifficulty() |
| 504 | { |
| 505 | return RPCMethod{ |
| 506 | "getdifficulty", |
| 507 | "Returns the proof-of-work difficulty as a multiple of the minimum difficulty.\n", |
| 508 | {}, |
| 509 | RPCResult{ |
| 510 | RPCResult::Type::NUM, "", "the proof-of-work difficulty as a multiple of the minimum difficulty."}, |
| 511 | RPCExamples{ |
| 512 | HelpExampleCli("getdifficulty", "") |
| 513 | + HelpExampleRpc("getdifficulty", "") |
| 514 | }, |
| 515 | [](const RPCMethod& self, const JSONRPCRequest& request) -> UniValue |
| 516 | { |
| 517 | ChainstateManager& chainman = EnsureAnyChainman(request.context); |
| 518 | LOCK(cs_main); |
| 519 | return GetDifficulty(*CHECK_NONFATAL(chainman.ActiveChain().Tip())); |
| 520 | }, |
| 521 | }; |
| 522 | } |
| 523 | |
| 524 | static RPCMethod getblockfrompeer() |
| 525 | { |
nothing calls this directly
no test coverage detected