Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcdump.cpp
Show First 20 Lines • Show All 113 Lines • ▼ Show 20 Lines | RPCHelpMan{ | ||||
"importprivkey", | "importprivkey", | ||||
"Adds a private key (as returned by dumpprivkey) to your wallet. " | "Adds a private key (as returned by dumpprivkey) to your wallet. " | ||||
"Requires a new wallet backup.\n" | "Requires a new wallet backup.\n" | ||||
"Hint: use importmulti to import more than one private key.\n" | "Hint: use importmulti to import more than one private key.\n" | ||||
"\nNote: This call can take minutes to complete if rescan is true, " | "\nNote: This call can take minutes to complete if rescan is true, " | ||||
"during that time, other rpc calls\n" | "during that time, other rpc calls\n" | ||||
"may report that the imported key exists but related transactions are " | "may report that the imported key exists but related transactions are " | ||||
"still missing, leading to temporarily incorrect/bogus balances and " | "still missing, leading to temporarily incorrect/bogus balances and " | ||||
"unspent outputs until rescan completes.\n", | "unspent outputs until rescan completes.\n" | ||||
"Note: Use \"getwalletinfo\" to query the scanning progress.\n", | |||||
{ | { | ||||
{"privkey", RPCArg::Type::STR, RPCArg::Optional::NO, | {"privkey", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
"The private key (see dumpprivkey)"}, | "The private key (see dumpprivkey)"}, | ||||
{"label", RPCArg::Type::STR, /* default */ | {"label", RPCArg::Type::STR, /* default */ | ||||
"current label if address exists, otherwise \"\"", | "current label if address exists, otherwise \"\"", | ||||
"An optional label"}, | "An optional label"}, | ||||
{"rescan", RPCArg::Type::BOOL, /* default */ "true", | {"rescan", RPCArg::Type::BOOL, /* default */ "true", | ||||
"Rescan the wallet for transactions"}, | "Rescan the wallet for transactions"}, | ||||
▲ Show 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | UniValue abortrescan(const Config &config, const JSONRPCRequest &request) { | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"abortrescan", | "abortrescan", | ||||
"Stops current wallet rescan triggered by an RPC call, e.g. by an " | "Stops current wallet rescan triggered by an RPC call, e.g. by an " | ||||
"importprivkey call.\n", | "importprivkey call.\n" | ||||
"Note: Use \"getwalletinfo\" to query the scanning progress.\n", | |||||
{}, | {}, | ||||
RPCResults{}, | RPCResults{}, | ||||
RPCExamples{"\nImport a private key\n" + | RPCExamples{"\nImport a private key\n" + | ||||
HelpExampleCli("importprivkey", "\"mykey\"") + | HelpExampleCli("importprivkey", "\"mykey\"") + | ||||
"\nAbort the running wallet rescan\n" + | "\nAbort the running wallet rescan\n" + | ||||
HelpExampleCli("abortrescan", "") + | HelpExampleCli("abortrescan", "") + | ||||
"\nAs a JSON-RPC call\n" + | "\nAs a JSON-RPC call\n" + | ||||
HelpExampleRpc("abortrescan", "")}, | HelpExampleRpc("abortrescan", "")}, | ||||
Show All 24 Lines | RPCHelpMan{ | ||||
"may report that the imported address exists but related transactions " | "may report that the imported address exists but related transactions " | ||||
"are still missing, leading to temporarily incorrect/bogus balances " | "are still missing, leading to temporarily incorrect/bogus balances " | ||||
"and unspent outputs until rescan completes.\n" | "and unspent outputs until rescan completes.\n" | ||||
"If you have the full public key, you should call importpubkey instead " | "If you have the full public key, you should call importpubkey instead " | ||||
"of this.\n" | "of this.\n" | ||||
"Hint: use importmulti to import more than one address.\n" | "Hint: use importmulti to import more than one address.\n" | ||||
"\nNote: If you import a non-standard raw script in hex form, outputs " | "\nNote: If you import a non-standard raw script in hex form, outputs " | ||||
"sending to it will be treated\n" | "sending to it will be treated\n" | ||||
"as change, and not show up in many RPCs.\n", | "as change, and not show up in many RPCs.\n" | ||||
"Note: Use \"getwalletinfo\" to query the scanning progress.\n", | |||||
{ | { | ||||
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, | {"address", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
"The Bitcoin address (or hex-encoded script)"}, | "The Bitcoin address (or hex-encoded script)"}, | ||||
{"label", RPCArg::Type::STR, /* default */ "\"\"", | {"label", RPCArg::Type::STR, /* default */ "\"\"", | ||||
"An optional label"}, | "An optional label"}, | ||||
{"rescan", RPCArg::Type::BOOL, /* default */ "true", | {"rescan", RPCArg::Type::BOOL, /* default */ "true", | ||||
"Rescan the wallet for transactions"}, | "Rescan the wallet for transactions"}, | ||||
{"p2sh", RPCArg::Type::BOOL, /* default */ "false", | {"p2sh", RPCArg::Type::BOOL, /* default */ "false", | ||||
▲ Show 20 Lines • Show All 239 Lines • ▼ Show 20 Lines | RPCHelpMan{ | ||||
"Adds a public key (in hex) that can be watched as if it were in " | "Adds a public key (in hex) that can be watched as if it were in " | ||||
"your wallet but cannot be used to spend. Requires a new wallet " | "your wallet but cannot be used to spend. Requires a new wallet " | ||||
"backup.\n" | "backup.\n" | ||||
"Hint: use importmulti to import more than one public key.\n" | "Hint: use importmulti to import more than one public key.\n" | ||||
"\nNote: This call can take minutes to complete if rescan is true, " | "\nNote: This call can take minutes to complete if rescan is true, " | ||||
"during that time, other rpc calls\n" | "during that time, other rpc calls\n" | ||||
"may report that the imported pubkey exists but related transactions " | "may report that the imported pubkey exists but related transactions " | ||||
"are still missing, leading to temporarily incorrect/bogus balances " | "are still missing, leading to temporarily incorrect/bogus balances " | ||||
"and unspent outputs until rescan completes.\n", | "and unspent outputs until rescan completes.\n" | ||||
"Note: Use \"getwalletinfo\" to query the scanning progress.\n", | |||||
{ | { | ||||
{"pubkey", RPCArg::Type::STR, RPCArg::Optional::NO, | {"pubkey", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
"The hex-encoded public key"}, | "The hex-encoded public key"}, | ||||
{"label", RPCArg::Type::STR, /* default */ "\"\"", | {"label", RPCArg::Type::STR, /* default */ "\"\"", | ||||
"An optional label"}, | "An optional label"}, | ||||
{"rescan", RPCArg::Type::BOOL, /* default */ "true", | {"rescan", RPCArg::Type::BOOL, /* default */ "true", | ||||
"Rescan the wallet for transactions"}, | "Rescan the wallet for transactions"}, | ||||
}, | }, | ||||
▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | UniValue importwallet(const Config &config, const JSONRPCRequest &request) { | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"importwallet", | "importwallet", | ||||
"Imports keys from a wallet dump file (see dumpwallet). Requires a " | "Imports keys from a wallet dump file (see dumpwallet). Requires a " | ||||
"new wallet backup to include imported keys.\n", | "new wallet backup to include imported keys.\n" | ||||
"Note: Use \"getwalletinfo\" to query the scanning progress.\n", | |||||
{ | { | ||||
{"filename", RPCArg::Type::STR, RPCArg::Optional::NO, | {"filename", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
"The wallet file"}, | "The wallet file"}, | ||||
}, | }, | ||||
RPCResults{}, | RPCResults{}, | ||||
RPCExamples{"\nDump the wallet\n" + | RPCExamples{"\nDump the wallet\n" + | ||||
HelpExampleCli("dumpwallet", "\"test\"") + | HelpExampleCli("dumpwallet", "\"test\"") + | ||||
"\nImport the wallet\n" + | "\nImport the wallet\n" + | ||||
▲ Show 20 Lines • Show All 903 Lines • ▼ Show 20 Lines | RPCHelpMan{ | ||||
"earliest creation time of the imported scripts. Requires a new wallet " | "earliest creation time of the imported scripts. Requires a new wallet " | ||||
"backup.\n" | "backup.\n" | ||||
"If an address/script is imported without all of the private keys " | "If an address/script is imported without all of the private keys " | ||||
"required to spend from that address, it will be watchonly. The " | "required to spend from that address, it will be watchonly. The " | ||||
"'watchonly' option must be set to true in this case or a warning will " | "'watchonly' option must be set to true in this case or a warning will " | ||||
"be returned.\n" | "be returned.\n" | ||||
"Conversely, if all the private keys are provided and the " | "Conversely, if all the private keys are provided and the " | ||||
"address/script is spendable, the watchonly option must be set to " | "address/script is spendable, the watchonly option must be set to " | ||||
"false, or a warning will be returned.\n", | "false, or a warning will be returned.\n" | ||||
"Note: Use \"getwalletinfo\" to query the scanning progress.\n", | |||||
{ | { | ||||
{"requests", | {"requests", | ||||
RPCArg::Type::ARR, | RPCArg::Type::ARR, | ||||
RPCArg::Optional::NO, | RPCArg::Optional::NO, | ||||
"Data to be imported", | "Data to be imported", | ||||
{ | { | ||||
{ | { | ||||
"", | "", | ||||
▲ Show 20 Lines • Show All 278 Lines • Show Last 20 Lines |