Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcdump.cpp
Show First 20 Lines • Show All 1,154 Lines • ▼ Show 20 Lines | try { | ||||
pwallet->MarkDirty(); | pwallet->MarkDirty(); | ||||
if (!pwallet->AddWatchOnly(redeemDestination, timestamp)) { | if (!pwallet->AddWatchOnly(redeemDestination, timestamp)) { | ||||
throw JSONRPCError(RPC_WALLET_ERROR, | throw JSONRPCError(RPC_WALLET_ERROR, | ||||
"Error adding address to wallet"); | "Error adding address to wallet"); | ||||
} | } | ||||
// add to address book or update label | // if not internal add to address book or update label | ||||
if (IsValidDestination(dest)) { | if (!internal) { | ||||
assert(IsValidDestination(dest)); | |||||
pwallet->SetAddressBook(dest, label, "receive"); | pwallet->SetAddressBook(dest, label, "receive"); | ||||
} | } | ||||
// Import private keys. | // Import private keys. | ||||
if (keys.size()) { | if (keys.size()) { | ||||
for (size_t i = 0; i < keys.size(); i++) { | for (size_t i = 0; i < keys.size(); i++) { | ||||
const std::string &privkey = keys[i].get_str(); | const std::string &privkey = keys[i].get_str(); | ||||
▲ Show 20 Lines • Show All 248 Lines • ▼ Show 20 Lines | if (mainRequest.fHelp || mainRequest.params.size() < 1 || mainRequest.params.size() > 2) { | ||||
" or the string \"now\" to substitute the current synced blockchain time. The timestamp of the oldest\n" | " or the string \"now\" to substitute the current synced blockchain time. The timestamp of the oldest\n" | ||||
" key will determine how far back blockchain rescans need to begin for missing wallet transactions.\n" | " key will determine how far back blockchain rescans need to begin for missing wallet transactions.\n" | ||||
" \"now\" can be specified to bypass scanning, for keys which are known to never have been used, and\n" | " \"now\" can be specified to bypass scanning, for keys which are known to never have been used, and\n" | ||||
" 0 can be specified to scan the entire blockchain. Blocks up to 2 hours before the earliest key\n" | " 0 can be specified to scan the entire blockchain. Blocks up to 2 hours before the earliest key\n" | ||||
" creation time of all keys being imported by the importmulti call will be scanned.\n" | " creation time of all keys being imported by the importmulti call will be scanned.\n" | ||||
" \"redeemscript\": \"<script>\" , (string, optional) Allowed only if the scriptPubKey is a P2SH address or a P2SH scriptPubKey\n" | " \"redeemscript\": \"<script>\" , (string, optional) Allowed only if the scriptPubKey is a P2SH address or a P2SH scriptPubKey\n" | ||||
" \"pubkeys\": [\"<pubKey>\", ... ] , (array, optional) Array of strings giving pubkeys that must occur in the output or redeemscript\n" | " \"pubkeys\": [\"<pubKey>\", ... ] , (array, optional) Array of strings giving pubkeys that must occur in the output or redeemscript\n" | ||||
" \"keys\": [\"<key>\", ... ] , (array, optional) Array of strings giving private keys whose corresponding public keys must occur in the output or redeemscript\n" | " \"keys\": [\"<key>\", ... ] , (array, optional) Array of strings giving private keys whose corresponding public keys must occur in the output or redeemscript\n" | ||||
" \"internal\": <true> , (boolean, optional, default: false) Stating whether matching outputs should be treated as not incoming payments\n" | " \"internal\": <true> , (boolean, optional, default: false) Stating whether matching outputs should be treated as not incoming payments aka change\n" | ||||
" \"watchonly\": <true> , (boolean, optional, default: false) Stating whether matching outputs should be considered watched even when they're not spendable, only allowed if keys are empty\n" | " \"watchonly\": <true> , (boolean, optional, default: false) Stating whether matching outputs should be considered watched even when they're not spendable, only allowed if keys are empty\n" | ||||
" \"label\": <label> , (string, optional, default: '') Label to assign to the address (aka account name, for now), only allowed with internal=false\n" | " \"label\": <label> , (string, optional, default: '') Label to assign to the address (aka account name, for now), only allowed with internal=false\n" | ||||
" }\n" | " }\n" | ||||
" ,...\n" | " ,...\n" | ||||
" ]\n" | " ]\n" | ||||
"2. options (json, optional)\n" | "2. options (json, optional)\n" | ||||
" {\n" | " {\n" | ||||
" \"rescan\": <false>, (boolean, optional, default: true) Stating if should rescan the blockchain after all imports\n" | " \"rescan\": <false>, (boolean, optional, default: true) Stating if should rescan the blockchain after all imports\n" | ||||
▲ Show 20 Lines • Show All 156 Lines • Show Last 20 Lines |