| 1195 | } |
| 1196 | |
| 1197 | UniValue verifychain(const UniValue& params, bool fHelp) |
| 1198 | { |
| 1199 | if (fHelp || params.size() > 2) |
| 1200 | throw runtime_error( |
| 1201 | "verifychain ( checklevel numblocks )\n" |
| 1202 | "\nVerifies blockchain database.\n" |
| 1203 | "\nArguments:\n" |
| 1204 | "1. checklevel (numeric, optional, 0-4, default=3) How thorough the block verification is.\n" |
| 1205 | "2. numblocks (numeric, optional, default=288, 0=all) The number of blocks to check.\n" |
| 1206 | "\nResult:\n" |
| 1207 | "true|false (boolean) Verified or not\n" |
| 1208 | "\nExamples:\n" + |
| 1209 | HelpExampleCli("verifychain", "") + HelpExampleRpc("verifychain", "")); |
| 1210 | |
| 1211 | LOCK(cs_main); |
| 1212 | |
| 1213 | int nCheckLevel = GetArg("-checklevel", 3); |
| 1214 | int nCheckDepth = GetArg("-checkblocks", 288); |
| 1215 | if (params.size() > 0) |
| 1216 | nCheckLevel = params[0].get_int(); |
| 1217 | if (params.size() > 1) |
| 1218 | nCheckDepth = params[1].get_int(); |
| 1219 | |
| 1220 | return CVerifyDB().VerifyDB(Params(), pcoinsTip, nCheckLevel, nCheckDepth); |
| 1221 | } |
| 1222 | |
| 1223 | static UniValue BIP9SoftForkDesc(const Consensus::Params& consensusParams, Consensus::DeploymentPos id) |
| 1224 | { |
nothing calls this directly
no test coverage detected