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

@sipa
Copy link
Member

@sipa sipa 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
Copy link
Member

@instagibbs instagibbs 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
Copy link
Contributor

@DrahtBot DrahtBot 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
Copy link
Member

@meshcollider meshcollider commented Nov 28, 2018

Concept ACK

Copy link
Member

@promag promag left a comment

utACK 0e75f44.

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

@promag promag Nov 28, 2018

nit, static. Could also keep some comment.

Copy link
Member

@instagibbs instagibbs Nov 28, 2018

Could even make it more specific with the updated behavior.

Copy link
Member

@Empact Empact Dec 7, 2018

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

@meshcollider
Copy link
Member

@meshcollider meshcollider commented Nov 30, 2018

utACK 0e75f44

@instagibbs
Copy link
Member

@instagibbs instagibbs commented Dec 2, 2018

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

@jonasschnelli
Copy link
Member

@jonasschnelli jonasschnelli commented Dec 9, 2018

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

@instagibbs
Copy link
Member

@instagibbs instagibbs commented Dec 10, 2018

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

@sipa
Copy link
Member Author

@sipa sipa commented Dec 13, 2018

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

@instagibbs
Copy link
Member

@instagibbs instagibbs commented Dec 13, 2018

sorry! no

utACK 0e75f44

@meshcollider meshcollider merged commit 0e75f44 into bitcoin:master Dec 14, 2018
2 checks passed
meshcollider added a commit that referenced this issue Dec 14, 2018
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
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this issue Jun 6, 2020
…ogic

Summary:
0e75f44a0 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.

---

Backport of Core [[bitcoin/bitcoin#14821 | PR14821]]

Test Plan:
  ninja check-all

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D6402
christiancfifi added a commit to christiancfifi/dash that referenced this issue Aug 24, 2021
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
christiancfifi added a commit to christiancfifi/dash that referenced this issue Aug 24, 2021
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
@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.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

8 participants