Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

importmulti: Don't add internal addresses to address book #14679

Merged
merged 1 commit into from
Nov 13, 2018

Conversation

instagibbs
Copy link
Member

@instagibbs instagibbs commented Nov 7, 2018

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.

Resolves #14662

@sipa
Copy link
Member

sipa commented Nov 7, 2018

This seems to be a bug that has existed since importmulti was introduced?

I guess few people import change addresses.

@instagibbs
Copy link
Member Author

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.

// add to address book or update label
if (IsValidDestination(scriptpubkey_dest)) {
// if not internal add to address book or update label
if (!internal && IsValidDestination(scriptpubkey_dest)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could just be:

if (!internal) {
    assert(IsValidDestination(scriptpubkey_dest));
    ...
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@DrahtBot
Copy link
Contributor

DrahtBot commented Nov 7, 2018

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #14565 (Overhaul importmulti logic by sipa)

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.

@fanquake fanquake added the Wallet label Nov 7, 2018
@meshcollider
Copy link
Contributor

Good catch, utACK 7afddfa

@sipa
Copy link
Member

sipa commented Nov 8, 2018

utACK 7afddfa

1 similar comment
@achow101
Copy link
Member

utACK 7afddfa

@laanwj laanwj merged commit 7afddfa into bitcoin:master Nov 13, 2018
laanwj added a commit that referenced this pull request Nov 13, 2018
7afddfa importmulti: Don't add internal addresses to address book (Gregory Sanders)

Pull request description:

  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.

  Resolves #14662

Tree-SHA512: a1f08dc624a3fadee93cc5392d50c4796b0c5eedf38e295382f71570f2066d9e978ed6e3962084b902989863fe1273a8642d8fdb094a266d69de10622a4176b0
@maflcko
Copy link
Member

maflcko commented Nov 30, 2018

fanquake added the Needs backport label a day ago

@fanquake Backport to what branch?

@maflcko maflcko added this to the 0.17.2 milestone Dec 5, 2018
@maflcko
Copy link
Member

maflcko commented Dec 5, 2018

Assigned 0.17.2, because it is not a new bug

@fanquake
Copy link
Member

Removed "Needs backport", being done in #14900.

meshcollider added a commit that referenced this pull request Dec 24, 2018
…sses to address book

ae1b675 importmulti: Don't add internal addresses to address book (Gregory Sanders)

Pull request description:

Tree-SHA512: 749e4864862bc3402a0fad200578804ce6577b4d954fd3e741191b4c941df28d54f98422f90e7fdf9bdf9c01e53ec36cf970e61d22ccc0478771285dd8cef6a0
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Feb 14, 2020
Summary:
7afddfa8cefd01249ad59cf2370e7cec90b34f6f importmulti: Don't add internal addresses to address book (Gregory Sanders)

Pull request description:

  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.

  Resolves bitcoin/bitcoin#14662

Tree-SHA512: a1f08dc624a3fadee93cc5392d50c4796b0c5eedf38e295382f71570f2066d9e978ed6e3962084b902989863fe1273a8642d8fdb094a266d69de10622a4176b0

Backport of Core [[bitcoin/bitcoin#14679 | PR14679]]
bitcoin/bitcoin#14679

Test Plan:
  ninja check
  ninja check-functional
  ./bitcoind
  ./bitcoin-cli help importmulti
Verify changes to help text.

Reviewers: O1 Bitcoin ABC, #bitcoin_abc, Fabien

Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D5288
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[wallet] importmulti doesn't honor internal flag
8 participants