MOVEONLY: Move abortrescan from backup.cpp to transactions.cpp

This commit is contained in:
Samuel Dobson
2021-12-08 11:54:08 +13:00
parent d794d0da8f
commit b36e738285
3 changed files with 28 additions and 28 deletions

View File

@@ -193,33 +193,6 @@ RPCHelpMan importprivkey()
};
}
RPCHelpMan abortrescan()
{
return RPCHelpMan{"abortrescan",
"\nStops current wallet rescan triggered by an RPC call, e.g. by an importprivkey call.\n"
"Note: Use \"getwalletinfo\" to query the scanning progress.\n",
{},
RPCResult{RPCResult::Type::BOOL, "", "Whether the abort was successful"},
RPCExamples{
"\nImport a private key\n"
+ HelpExampleCli("importprivkey", "\"mykey\"") +
"\nAbort the running wallet rescan\n"
+ HelpExampleCli("abortrescan", "") +
"\nAs a JSON-RPC call\n"
+ HelpExampleRpc("abortrescan", "")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
std::shared_ptr<CWallet> const pwallet = GetWalletForJSONRPCRequest(request);
if (!pwallet) return NullUniValue;
if (!pwallet->IsScanning() || pwallet->IsAbortingRescan()) return false;
pwallet->AbortRescan();
return true;
},
};
}
RPCHelpMan importaddress()
{
return RPCHelpMan{"importaddress",