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: Optimize stake node pruning. #2943

Merged
merged 3 commits into from May 13, 2022

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented May 10, 2022

This optimizes the logic that prunes stake nodes when connecting blocks to make use of the best known header instead of the latest known checkpoint.

While here, it also adds an exported method to the block index to retrieve the best header node under the block index mutex and updates the various call sites that do it manually to use the newly exported function instead as well as exports the block index flush function to make it more consistent with the other funcs that are safe for concurrent access.

blockchain/chainquery.go Outdated Show resolved Hide resolved
This exports the block index flush function to make it more consistent
with the other funcs that are safe for concurrent access.
This adds an exported method to the block index to retrieve the best
header node under the block index mutex and updates the various call
sites that do it manually to use the newly exported function instead.
This optimizes the logic that prunes stake nodes when connecting blocks
to make use of the best known header instead of the latest known
checkpoint.
@davecgh davecgh force-pushed the blockchain_optimize_stakenode_pruning branch from 06954dd to bbccddf Compare May 13, 2022 07:18
@davecgh davecgh merged commit bbccddf into decred:master May 13, 2022
@davecgh davecgh deleted the blockchain_optimize_stakenode_pruning branch May 13, 2022 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants