Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcdump.cpp
Show First 20 Lines • Show All 162 Lines • ▼ Show 20 Lines | CKeyID vchAddress = pubkey.GetID(); | ||||
if (fRescan) { | if (fRescan) { | ||||
pwallet->ScanForWalletTransactions(chainActive.Genesis(), true); | pwallet->ScanForWalletTransactions(chainActive.Genesis(), true); | ||||
} | } | ||||
} | } | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
UniValue abortrescan(const Config &config, const JSONRPCRequest &request) { | |||||
CWallet *const pwallet = GetWalletForJSONRPCRequest(request); | |||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | |||||
return NullUniValue; | |||||
} | |||||
if (request.fHelp || request.params.size() > 0) { | |||||
throw std::runtime_error("abortrescan\n" | |||||
"\nStops current wallet rescan triggered e.g. " | |||||
"by an importprivkey call.\n" | |||||
"\nExamples:\n" | |||||
"\nImport a private key\n" + | |||||
HelpExampleCli("importprivkey", "\"mykey\"") + | |||||
"\nAbort the running wallet rescan\n" + | |||||
HelpExampleCli("abortrescan", "") + | |||||
"\nAs a JSON-RPC call\n" + | |||||
HelpExampleRpc("abortrescan", "")); | |||||
} | |||||
if (!pwallet->IsScanning() || pwallet->IsAbortingRescan()) { | |||||
return false; | |||||
} | |||||
pwallet->AbortRescan(); | |||||
return true; | |||||
} | |||||
void ImportAddress(CWallet *, const CTxDestination &dest, | void ImportAddress(CWallet *, const CTxDestination &dest, | ||||
const std::string &strLabel); | const std::string &strLabel); | ||||
void ImportScript(CWallet *const pwallet, const CScript &script, | void ImportScript(CWallet *const pwallet, const CScript &script, | ||||
const std::string &strLabel, bool isRedeemScript) { | const std::string &strLabel, bool isRedeemScript) { | ||||
if (!isRedeemScript && ::IsMine(*pwallet, script) == ISMINE_SPENDABLE) { | if (!isRedeemScript && ::IsMine(*pwallet, script) == ISMINE_SPENDABLE) { | ||||
throw JSONRPCError(RPC_WALLET_ERROR, "The wallet already contains the " | throw JSONRPCError(RPC_WALLET_ERROR, "The wallet already contains the " | ||||
"private key for this address or " | "private key for this address or " | ||||
"script"); | "script"); | ||||
▲ Show 20 Lines • Show All 1,167 Lines • ▼ Show 20 Lines | UniValue importmulti(const Config &config, const JSONRPCRequest &mainRequest) { | ||||
return response; | return response; | ||||
} | } | ||||
// clang-format off | // clang-format off | ||||
static const ContextFreeRPCCommand commands[] = { | static const ContextFreeRPCCommand commands[] = { | ||||
// category name actor (function) okSafeMode | // category name actor (function) okSafeMode | ||||
// ------------------- ------------------------ ---------------------- ---------- | // ------------------- ------------------------ ---------------------- ---------- | ||||
{ "wallet", "abortrescan", abortrescan, false, {} }, | |||||
{ "wallet", "dumpprivkey", dumpprivkey, true, {"address"} }, | { "wallet", "dumpprivkey", dumpprivkey, true, {"address"} }, | ||||
{ "wallet", "dumpwallet", dumpwallet, true, {"filename"} }, | { "wallet", "dumpwallet", dumpwallet, true, {"filename"} }, | ||||
{ "wallet", "importmulti", importmulti, true, {"requests","options"} }, | { "wallet", "importmulti", importmulti, true, {"requests","options"} }, | ||||
{ "wallet", "importprivkey", importprivkey, true, {"privkey","label","rescan"} }, | { "wallet", "importprivkey", importprivkey, true, {"privkey","label","rescan"} }, | ||||
{ "wallet", "importwallet", importwallet, true, {"filename"} }, | { "wallet", "importwallet", importwallet, true, {"filename"} }, | ||||
{ "wallet", "importaddress", importaddress, true, {"address","label","rescan","p2sh"} }, | { "wallet", "importaddress", importaddress, true, {"address","label","rescan","p2sh"} }, | ||||
{ "wallet", "importprunedfunds", importprunedfunds, true, {"rawtransaction","txoutproof"} }, | { "wallet", "importprunedfunds", importprunedfunds, true, {"rawtransaction","txoutproof"} }, | ||||
{ "wallet", "importpubkey", importpubkey, true, {"pubkey","label","rescan"} }, | { "wallet", "importpubkey", importpubkey, true, {"pubkey","label","rescan"} }, | ||||
Show All 13 Lines |