MCPcopy Create free account
hub / github.com/LUX-Core/lux / getdifficulty

Function getdifficulty

src/rpcblockchain.cpp:172–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172UniValue 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
191UniValue getrawmempool(const UniValue& params, bool fHelp)
192{

Callers

nothing calls this directly

Calls 7

HelpExampleCliFunction · 0.85
HelpExampleRpcFunction · 0.85
PairFunction · 0.85
GetDifficultyFunction · 0.85
GetLastBlockIndexFunction · 0.85
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected