From ae1b6756c96f78985e88fa5b0c68ccad90f5e259 Mon Sep 17 00:00:00 2001 From: Gregory Sanders Date: Wed, 7 Nov 2018 11:24:34 -0500 Subject: importmulti: Don't add internal addresses to address book Github-Pull: #14679 Rebased-From: 7afddfa8cefd01249ad59cf2370e7cec90b34f6f --- src/wallet/rpcdump.cpp | 7 ++++--- test/functional/wallet_importmulti.py | 7 ++++--- 2 files changed, 8 insertions(+), 6 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\": \"