aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGregory Sanders <gsanders87@gmail.com>2018-11-07 11:24:34 -0500
committerfanquake <fanquake@gmail.com>2018-12-09 22:32:45 +0800
commitae1b6756c96f78985e88fa5b0c68ccad90f5e259 (patch)
treece7f269cd36cc48dee7b00272d86dc0203af1ecc /src
parentef70f9b52b851c7997a9f1a0834714e3eebc1fd8 (diff)
downloadbitcoin-ae1b6756c96f78985e88fa5b0c68ccad90f5e259.tar.xz
importmulti: Don't add internal addresses to address book
Github-Pull: #14679 Rebased-From: 7afddfa8cefd01249ad59cf2370e7cec90b34f6f
Diffstat (limited to 'src')
-rw-r--r--src/wallet/rpcdump.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp
index 5800e75827..a55c539733 100644
--- a/src/wallet/rpcdump.cpp
+++ b/src/wallet/rpcdump.cpp
@@ -996,8 +996,9 @@ static UniValue ProcessImport(CWallet * const pwallet, const UniValue& data, con
throw JSONRPCError(RPC_WALLET_ERROR, "Error adding address to wallet");
}
- // add to address book or update label
- if (IsValidDestination(pubkey_dest)) {
+ // if not internal add to address book or update label
+ if (!internal) {
+ assert(IsValidDestination(pubkey_dest));
pwallet->SetAddressBook(pubkey_dest, label, "receive");
}
@@ -1148,7 +1149,7 @@ UniValue importmulti(const JSONRPCRequest& mainRequest)
" \"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"
" \"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"
" \"label\": <label> , (string, optional, default: '') Label to assign to the address (aka account name, for now), only allowed with internal=false\n"
" }\n"