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 block locator generation. #1237

Merged
merged 1 commit into from
Jun 1, 2018

Commits on Jun 1, 2018

  1. blockchain: Optimize block locator generation.

    This significantly optimizes and simplifies the generation of block
    locators by making use of the fact that all block nodes are now in
    memory and therefore it is no longer necessary to consult the database
    for the hashes or worry about issues related to dynamic loading of nodes.
    
    Also, it slightly modifies the algorithm so that the doubling doesn't
    start for one additional iteration in order to mirror the upstream code.
    Due to the way block locators are used, this does not change any
    semantics in terms of requesting and locating blocks.
    
    Finally, the semantics of BlockLocatorFromHash have been changed to
    return a locator for the current tip in the case the hash is unknown.
    This is preferable since only including the passed block hash, when it
    isn't known, could end up leading to causing a redownload of the entire
    chain under certain circumstances.
    davecgh committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    afb80b9 View commit details
    Browse the repository at this point in the history