MCPcopy Create free account
hub / github.com/ElementsProject/elements / getdifficulty

Function getdifficulty

src/rpc/blockchain.cpp:495–513  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

493}
494
495static RPCHelpMan getdifficulty()
496{
497 return RPCHelpMan{"getdifficulty",
498 "\nReturns the proof-of-work difficulty as a multiple of the minimum difficulty.\n",
499 {},
500 RPCResult{
501 RPCResult::Type::NUM, "", "the proof-of-work difficulty as a multiple of the minimum difficulty."},
502 RPCExamples{
503 HelpExampleCli("getdifficulty", "")
504 + HelpExampleRpc("getdifficulty", "")
505 },
506 [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
507{
508 ChainstateManager& chainman = EnsureAnyChainman(request.context);
509 LOCK(cs_main);
510 return GetDifficulty(chainman.ActiveChain().Tip());
511},
512 };
513}
514
515static std::vector<RPCResult> MempoolEntryDescription() { return {
516 RPCResult{RPCResult::Type::NUM, "vsize", "virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted."},

Callers

nothing calls this directly

Calls 4

HelpExampleCliFunction · 0.85
HelpExampleRpcFunction · 0.85
GetDifficultyFunction · 0.85
TipMethod · 0.45

Tested by

no test coverage detected