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

Function verifychain

src/rpc/blockchain.cpp:1135–1161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1133}
1134
1135static UniValue verifychain(const JSONRPCRequest& request)
1136{
1137 int nCheckLevel = gArgs.GetArg("-checklevel", DEFAULT_CHECKLEVEL);
1138 int nCheckDepth = gArgs.GetArg("-checkblocks", DEFAULT_CHECKBLOCKS);
1139 if (request.fHelp || request.params.size() > 2)
1140 throw std::runtime_error(
1141 "verifychain ( checklevel nblocks )\n"
1142 "\nVerifies blockchain database.\n"
1143 "\nArguments:\n"
1144 "1. checklevel (numeric, optional, 0-4, default=" + strprintf("%d", nCheckLevel) + ") How thorough the block verification is.\n"
1145 "2. nblocks (numeric, optional, default=" + strprintf("%d", nCheckDepth) + ", 0=all) The number of blocks to check.\n"
1146 "\nResult:\n"
1147 "true|false (boolean) Verified or not\n"
1148 "\nExamples:\n"
1149 + HelpExampleCli("verifychain", "")
1150 + HelpExampleRpc("verifychain", "")
1151 );
1152
1153 LOCK(cs_main);
1154
1155 if (!request.params[0].isNull())
1156 nCheckLevel = request.params[0].get_int();
1157 if (!request.params[1].isNull())
1158 nCheckDepth = request.params[1].get_int();
1159
1160 return CVerifyDB().VerifyDB(Params(), pcoinsTip.get(), nCheckLevel, nCheckDepth);
1161}
1162
1163/** Implementation of IsSuperMajority with better feedback */
1164static UniValue SoftForkMajorityDesc(int version, CBlockIndex* pindex, const Consensus::Params& consensusParams)

Callers

nothing calls this directly

Calls 10

HelpExampleCliFunction · 0.85
HelpExampleRpcFunction · 0.85
CVerifyDBClass · 0.85
isNullMethod · 0.80
get_intMethod · 0.80
VerifyDBMethod · 0.80
getMethod · 0.80
ParamsClass · 0.50
GetArgMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected