Skip to content

Fix derivable-descriptor detection during wallet sync - #692

Closed
evanlinjin wants to merge 1 commit into
bitcoindevkit:masterfrom
evanlinjin:fix-non-derivable-desc-detection
Closed

Fix derivable-descriptor detection during wallet sync#692
evanlinjin wants to merge 1 commit into
bitcoindevkit:masterfrom
evanlinjin:fix-non-derivable-desc-detection

Conversation

@evanlinjin

@evanlinjin evanlinjin commented Jul 30, 2022

Copy link
Copy Markdown
Member

Description

This fix is for electrum-based blockchains.

Previously, it was assumed that containing > 1 spks in database means the descriptor is derivable, however each database tracks two descriptors so it should really check > 2.

Notes to the reviewers

This is a touch-up on work done in #672

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

Bugfixes:

* [ ] This pull request breaks the existing API
* [ ] I've added tests to reproduce the issue which are now passing
* [ ] I'm linking the issue being fixed by this PR

This fix is for electrum-based blockchains.

Previously, it was assumed that containing > 1 spks in database means
the descriptor is derivable, however each database tracks two
descriptors so it should really check > 2.
@evanlinjin
evanlinjin force-pushed the fix-non-derivable-desc-detection branch from 9349d3c to 9d2bea2 Compare July 30, 2022 13:54
@evanlinjin
evanlinjin marked this pull request as ready for review July 30, 2022 14:02

@danielabrozzoni danielabrozzoni left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

utACK 9d2bea2

@danielabrozzoni

Copy link
Copy Markdown
Contributor

Can you add a test to reproduce the bug? I suppose that having one wallet with two non-derivable descriptors should do it

@evanlinjin

Copy link
Copy Markdown
Member Author

@danielabrozzoni Thanks for the tip! I realized I confused myself. 😅

I forgot that ScriptReq::satisfy works with "one keychain at a time" so let is_derivable = self.initial_scripts_needed > 1; (the original) is correct.

I'll close this PR.

@evanlinjin evanlinjin closed this Aug 2, 2022
@notmandatory notmandatory removed this from the Release 0.21.0 Feature Freeze milestone Aug 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants