Skip to content

Conversation

@achow101
Copy link
Member

Import internal descriptors were having address book entries added which meant they would be detected as non-change. Fix this and add a test for it.

@DrahtBot
Copy link
Contributor

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

Conflicts

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.

@maflcko
Copy link
Member

maflcko commented Oct 30, 2020

Is this for 0.21?

@achow101
Copy link
Member Author

achow101 commented Nov 1, 2020

Is this for 0.21?

Yes, this is a bug fix.

@maflcko maflcko added this to the 0.21.0 milestone Nov 2, 2020
@jnewbery jnewbery changed the title Fix change detection of imported internal descriptors wallet: fix change detection of imported internal descriptors Nov 2, 2020
Copy link
Contributor

@meshcollider meshcollider left a comment

Choose a reason for hiding this comment

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

utACK bd93fc9

Good catch

@fanquake
Copy link
Member

fanquake commented Nov 6, 2020

@S3RK you might be interested in reviewing?


CTxDestination dest;
if (ExtractDestination(script_pub_keys.at(0), dest)) {
if (!internal && ExtractDestination(script_pub_keys.at(0), dest)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it expected that we will set an empty label even when a label is not specified in request at all?

nit: I think it's more clear to make all the checks in the parent if (for range, internal and for label emptiness). This also might help to avoid unnecessary log message above.

Copy link
Member Author

Choose a reason for hiding this comment

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

Is it expected that we will set an empty label even when a label is not specified in request at all?

Yes.

Copy link
Member Author

Choose a reason for hiding this comment

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

Moved it up.

Copy link
Member Author

Choose a reason for hiding this comment

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

On second thought, nevermind. Reverted back to previous.

Moving it up will make the boolean logic at the outer if a little more confusing, and I think it's fine (perhaps even good) to be checking that scriptPubKeys were being generated for non-ranged things.

Copy link
Contributor

Choose a reason for hiding this comment

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

On second thought, nevermind. Reverted back to previous.

Moving it up will make the boolean logic at the outer if a little more confusing, and I think it's fine (perhaps even good) to be checking that scriptPubKeys were being generated for non-ranged things.

Though the check becomes redundant after #20153 I think I maybe even should drop it in my PR

@achow101 achow101 force-pushed the fix-desc-change branch 2 times, most recently from 2b35435 to bd93fc9 Compare November 6, 2020 16:45
Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

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

Code review ACK bd93fc9.

@fanquake fanquake requested a review from meshcollider November 9, 2020 00:34
@laanwj
Copy link
Member

laanwj commented Nov 9, 2020

Code review ACK bd93fc9

@laanwj laanwj merged commit 663fd92 into bitcoin:master Nov 9, 2020
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Nov 9, 2020
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Dec 22, 2021
Summary:
Import internal descriptors were having address book entries added which meant they would be detected as non-change. Fix this and add a test for it.

This is a backport of [[bitcoin/bitcoin#20266 | core#20266]]

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D10719
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants