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

Combine concepts: xpub and last used index #479

Merged
merged 3 commits into from
Jun 11, 2024

Conversation

jholdstock
Copy link
Member

Previously the extended public key and the last used address index for that key were two values stored and handled separately. This PR combines the concepts and handles them as a single unit by wrapping them into a new struct FeeXPub.

The underlying format for storing these values in the database does not change. The only change is the interface between the database code and the calling code.

Copy link
Member

@davecgh davecgh left a comment

Choose a reason for hiding this comment

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

Nice change. It makes sense to keep them together since they are tightly coupled.

database/addressindex.go Outdated Show resolved Hide resolved
Moving the xpub accessors to the address index file is the first step
towards combining these two concepts and treating them as a single
object.
Fee xpub key and last used address index are now wrapped into a struct,
with both fields being set and retrieved together rather than
individually.

The underlying format for storing these values in the database does not
change. The only change is the interface between the database code and
the caller.
@jholdstock
Copy link
Member Author

Rebased on master and implemented suggestion.

Copy link
Member

@davecgh davecgh left a comment

Choose a reason for hiding this comment

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

Still looks good after the update.

@jholdstock jholdstock merged commit 0633260 into decred:master Jun 11, 2024
2 checks passed
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.

2 participants