Initial implementation of abortrescan
This commit is contained in:
@@ -144,6 +144,36 @@ UniValue convertpassphrase(const UniValue& params, bool fHelp, const CPubKey& my
|
||||
return ret;
|
||||
}
|
||||
|
||||
UniValue abortrescan(const UniValue& params, bool fHelp, const CPubKey& mypk)
|
||||
{
|
||||
if (!EnsureWalletIsAvailable(fHelp))
|
||||
return NullUniValue;
|
||||
|
||||
if (fHelp || params.size() > 0)
|
||||
throw runtime_error(
|
||||
"abortrescan\n"
|
||||
"\nAbort a currently running rescan.\n"
|
||||
"\nUse 'getrescaninfo' to get rescan progress details.\n"
|
||||
"\nReturns true if aborting rescan, false otherwise.\n"
|
||||
"\nArguments: none\n"
|
||||
"\nExamples:\n"
|
||||
"\nAbort rescan :\n"
|
||||
+ HelpExampleCli("abortrescan","")
|
||||
+ "\nAs a JSON-RPC call\n"
|
||||
+ HelpExampleRpc("abortrescan","")
|
||||
);
|
||||
if(!pwalletMain->fRescanning) {
|
||||
LogPrintf("%s: no rescan running\n",__func__);
|
||||
return false;
|
||||
}
|
||||
if(pwalletMain->IsAbortingRescan()) {
|
||||
LogPrintf("%s: already aborting current rescan\n",__func__);
|
||||
return false;
|
||||
}
|
||||
pwalletMain->AbortRescan();
|
||||
return true;
|
||||
}
|
||||
|
||||
UniValue getrescaninfo(const UniValue& params, bool fHelp, const CPubKey& mypk)
|
||||
{
|
||||
if (!EnsureWalletIsAvailable(fHelp))
|
||||
|
||||
Reference in New Issue
Block a user