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

blockchain: Faster chain view block locator. #1338

Merged
merged 1 commit into from
Jul 20, 2018

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Jul 7, 2018

This requires PR #1337.

This exposes the ability to more efficiently create a block locator from a chain view for a given block node by using their ability to do O(1) lookups.

It also adds tests to ensure the behavior is correct.

@davecgh davecgh force-pushed the blockchain_chainview_blocklocator branch 2 times, most recently from 25760b2 to 761d0c6 Compare July 9, 2018 19:54
@davecgh davecgh added this to the 1.3.0 milestone Jul 9, 2018
@davecgh davecgh force-pushed the blockchain_chainview_blocklocator branch from 761d0c6 to a5122d0 Compare July 10, 2018 05:23

// BlockLocator returns a block locator for the passed block node. The passed
// node can be nil in which case the block locator for the current tip
// associated with the view will be returned. This only differs from the
Copy link
Member

Choose a reason for hiding this comment

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

This /is/ the exported version :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice catch. Copy pasta strikes! Fixed.

@davecgh davecgh force-pushed the blockchain_chainview_blocklocator branch 2 times, most recently from 26a8f54 to 4c30593 Compare July 11, 2018 02:24
This exposes the ability to more efficiently create a block locator from
a chain view for a given block node by using their ability to do O(1)
lookups.

It also adds tests to ensure the behavior is correct.
@davecgh davecgh force-pushed the blockchain_chainview_blocklocator branch from 4c30593 to 6254fea Compare July 20, 2018 21:54
@davecgh davecgh merged commit 6254fea into decred:master Jul 20, 2018
@davecgh davecgh deleted the blockchain_chainview_blocklocator branch July 20, 2018 22:20
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.

4 participants