MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / verifychain

Function verifychain

src/rpc/rpcblockchain.cpp:273–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

271}
272
273Value verifychain(const Array& params, bool fHelp) {
274 if (fHelp || params.size() > 2) {
275 throw runtime_error(
276 "verifychain ( checklevel numofblocks )\n"
277 "\nVerifies blockchain database.\n"
278 "\nArguments:\n"
279 "1.\"checklevel\" (numeric, optional, 0-4, default=3) How thorough the block verification is.\n"
280 "2.\"numofblocks\" (numeric, optional, default=1288, 0=all) The number of blocks to check.\n"
281 "\nResult:\n"
282 "true|false (boolean) Verified Okay or not\n"
283 "\nExamples:\n" +
284 HelpExampleCli("verifychain", "") + "\nAs json rpc\n" + HelpExampleRpc("verifychain", "4, 10000"));
285 }
286
287 int nCheckLevel = SysCfg().GetArg("-checklevel", 3);
288 int nCheckDepth = SysCfg().GetArg("-checkblocks", 1288);
289 if (params.size() > 0)
290 nCheckLevel = params[0].get_int();
291 if (params.size() > 1)
292 nCheckDepth = params[1].get_int();
293
294 return VerifyDB(nCheckLevel, nCheckDepth);
295}
296
297Value getcontractregid(const Array& params, bool fHelp) {
298 if (fHelp || params.size() != 1) {

Callers

nothing calls this directly

Calls 6

HelpExampleCliFunction · 0.85
HelpExampleRpcFunction · 0.85
VerifyDBFunction · 0.85
GetArgMethod · 0.80
get_intMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected