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

Replace CAffectedKeysVisitor with descriptor based logic #14821

Merged

Conversation

Projects
None yet
8 participants
@sipa
Copy link
Member

commented Nov 27, 2018

It seems we don't need a custom visitor pattern anymore to find what keys are affected by a script. Instead, infer the descriptor, and see which keys it expands to.

@instagibbs

This comment has been minimized.

Copy link
Member

commented Nov 27, 2018

+13 −67

concept ACK, note that this will now include pubkeys you have, not only private keys, which I think is a more sane general anyways.

@DrahtBot

This comment has been minimized.

Copy link
Contributor

commented Nov 27, 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:

  • #14144 (Refactoring: Clarify code using encrypted_batch in CWallet by domob1812)

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.

@meshcollider

This comment has been minimized.

Copy link
Member

commented Nov 28, 2018

Concept ACK

@promag
Copy link
Member

left a comment

utACK 0e75f44.

if (keystore.HaveKey(id)) {
vKeys.push_back(id);
}
std::vector<CKeyID> GetAffectedKeys(const CScript& spk, const SigningProvider& provider)

This comment has been minimized.

Copy link
@promag

promag Nov 28, 2018

Member

nit, static. Could also keep some comment.

This comment has been minimized.

Copy link
@instagibbs

instagibbs Nov 28, 2018

Member

Could even make it more specific with the updated behavior.

This comment has been minimized.

Copy link
@Empact

Empact Dec 7, 2018

Member

nit: script_pub_key would be a more readable arg name. Granted I’m a noob but I had to check the callers.

@meshcollider

This comment has been minimized.

Copy link
Member

commented Nov 30, 2018

utACK 0e75f44

@instagibbs

This comment has been minimized.

Copy link
Member

commented Dec 2, 2018

@sipa if you'd like you could take this test: instagibbs@a80edd7

@jonasschnelli

This comment has been minimized.

Copy link
Member

commented Dec 9, 2018

utACK 0e75f44
also in favour to pull in
instagibbs@a80edd7

@instagibbs

This comment has been minimized.

Copy link
Member

commented Dec 10, 2018

@jonasschnelli I ended up PRing it, that commit is bad anyways: #14857

@sipa

This comment has been minimized.

Copy link
Member Author

commented Dec 13, 2018

@instagibbs #14857 is merged, any suggested improvements to this PR left?

@instagibbs

This comment has been minimized.

Copy link
Member

commented Dec 13, 2018

sorry! no

utACK 0e75f44

@meshcollider meshcollider merged commit 0e75f44 into bitcoin:master Dec 14, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

meshcollider added a commit that referenced this pull request Dec 14, 2018

Merge #14821: Replace CAffectedKeysVisitor with descriptor based logic
0e75f44 Replace CAffectedKeysVisitor with descriptor based logic (Pieter Wuille)

Pull request description:

  It seems we don't need a custom visitor pattern anymore to find what keys are affected by a script. Instead, infer the descriptor, and see which keys it expands to.

Tree-SHA512: 8a52f61fb74e8ebfd8d02e759629e423ced6bd7d9a9ee7c4bdd2cca8465bc27b951cc69c8d835244a611ba55c6d22f83b81acef05487cb988c88c0951b797699
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.