diff options
| author | Jeff Garzik <[email protected]> | 2013-06-22 23:08:13 -0700 |
|---|---|---|
| committer | Jeff Garzik <[email protected]> | 2013-06-22 23:08:13 -0700 |
| commit | 4be2aba302a30812df6962c5ea3b81669ed630e9 (patch) | |
| tree | a13baf0711b1db62143bc2d00d2f0d48a64106e9 /src/rpcblockchain.cpp | |
| parent | Merge pull request #2660 from TheBlueMatt/gmfrefactor (diff) | |
| parent | RPC: add 'verifychain', to verify chain database at runtime (diff) | |
| download | discoin-4be2aba302a30812df6962c5ea3b81669ed630e9.tar.xz discoin-4be2aba302a30812df6962c5ea3b81669ed630e9.zip | |
Merge pull request #2778 from jgarzik/rpc-verifydb
RPC: add 'verifychain' to verify chain database at runtime
Diffstat (limited to 'src/rpcblockchain.cpp')
| -rw-r--r-- | src/rpcblockchain.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index a0ddc4d9e..6b2ef8315 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -243,4 +243,20 @@ Value gettxout(const Array& params, bool fHelp) return ret; } +Value verifychain(const Array& params, bool fHelp) +{ + if (fHelp || params.size() > 2) + throw runtime_error( + "verifychain [check level] [num blocks]\n" + "Verifies blockchain database."); + + int nCheckLevel = GetArg("-checklevel", 3); + int nCheckDepth = GetArg("-checkblocks", 288); + if (params.size() > 0) + nCheckLevel = params[0].get_int(); + if (params.size() > 1) + nCheckDepth = params[1].get_int(); + + return VerifyDB(nCheckLevel, nCheckDepth); +} |