From 7afddfa8cefd01249ad59cf2370e7cec90b34f6f Mon Sep 17 00:00:00 2001 From: Gregory Sanders Date: Wed, 7 Nov 2018 11:24:34 -0500 Subject: [PATCH] importmulti: Don't add internal addresses to address book --- src/wallet/rpcdump.cpp | 7 ++++--- test/functional/wallet_importmulti.py | 9 ++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index 2a4cf0147..a3bb27323 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -994,8 +994,9 @@ static UniValue ProcessImport(CWallet * const pwallet, const UniValue& data, con throw JSONRPCError(RPC_WALLET_ERROR, "Error adding scriptPubKey script to wallet"); } - // add to address book or update label - if (IsValidDestination(scriptpubkey_dest)) { + // if not internal add to address book or update label + if (!internal) { + assert(IsValidDestination(scriptpubkey_dest)); pwallet->SetAddressBook(scriptpubkey_dest, label, "receive"); } @@ -1087,7 +1088,7 @@ UniValue importmulti(const JSONRPCRequest& mainRequest) " \"witnessscript\": \"