Currently anything imported with internal will not be treated as change since checking the address book is a primary test of this.
Added basic tests of all combinations of arguments and change identification.
Currently anything imported with internal will not be treated as change since checking the address book is a primary test of this.
Added basic tests of all combinations of arguments and change identification.
This seems to be a bug that has existed since importmulti was introduced?
I guess few people import change addresses.
Yes, it's been here since the introduction I believe.
With my hww setup I use PSBTs which have no notion of IsChange, so I've never run into it. Only realized this by reviewing your other PR.
993 | @@ -994,8 +994,8 @@ static UniValue ProcessImport(CWallet * const pwallet, const UniValue& data, con 994 | throw JSONRPCError(RPC_WALLET_ERROR, "Error adding scriptPubKey script to wallet"); 995 | } 996 | 997 | - // add to address book or update label 998 | - if (IsValidDestination(scriptpubkey_dest)) { 999 | + // if not internal add to address book or update label 1000 | + if (!internal && IsValidDestination(scriptpubkey_dest)) {
I think this could just be:
if (!internal) {
assert(IsValidDestination(scriptpubkey_dest));
...
}
done
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
utACK 7afddfa8cefd01249ad59cf2370e7cec90b34f6f
utACK 7afddfa8cefd01249ad59cf2370e7cec90b34f6f
fanquake added the Needs backport label a day ago @fanquake Backport to what branch?
Assigned 0.17.2, because it is not a new bug
Milestone
0.17.2