Optimize sending of getheaders when pindexLast is an ancestor of pindexBestHeader #9091

pull rebroad wants to merge 1 commits into bitcoin:master from rebroad:OptimizeMoreGetheaders changing 1 files +33 −4
  1. rebroad commented at 2:41 PM on November 6, 2016: contributor

    This has been a TODO since #4468

    Comments in the code to make it (hopefully) understandable.

    Please review/test. Thank you.

    This is possibly still work in progress... needing to understand GetLocator in more detail, it may be that the best two options are to GetLocator(chainActive.Tip()) or GetLocator(pindexBestHeader). I'm also not assuming that chainActive.Tip() isn't always an ancestor of pindexBestHeader (based on the "TODO: optimize" comment that was made in #4468).

  2. in src/main.cpp:None in a165da3264 outdated
    5976 | +            std::string strDesc;
    5977 | +            if (LastCommonAncestor(pindexLast, pindexBestHeader) == pindexLast) {
    5978 | +                // received header is an ancestor of pindexBestHeader (cases 2, 3, 4, 5)
    5979 | +                CBlockIndex *pindexFork = LastCommonAncestor(pindexBestHeader, chainActive.Tip());
    5980 | +                if (pindexFork == chainActive.Tip()) {
    5981 | +                    // Out current tip an ancestor of pindexBestHeader
    


    dcousens commented at 2:51 AM on November 7, 2016:

    s/Out/Our?


    rebroad commented at 3:18 AM on November 7, 2016:

    @dcousens Thanks for taking a look at this. Fixed.

  3. rebroad renamed this:
    Optimize sending of getheaders when pindexLast is an ancestor of pindexBestHeader
    WIP: Optimize sending of getheaders when pindexLast is an ancestor of pindexBestHeader
    on Nov 7, 2016
  4. rebroad force-pushed on Nov 7, 2016
  5. rebroad renamed this:
    WIP: Optimize sending of getheaders when pindexLast is an ancestor of pindexBestHeader
    Optimize sending of getheaders when pindexLast is an ancestor of pindexBestHeader
    on Nov 7, 2016
  6. rebroad force-pushed on Nov 7, 2016
  7. rebroad added the label P2P on Nov 7, 2016
  8. Optimize sending of getheaders when pindexLast is an ancestor of
    pindexBestHeader
    
    Needed since #4468
    e210622998
  9. rebroad force-pushed on Dec 10, 2016
  10. fanquake closed this on May 17, 2017

  11. cryptozeny commented at 5:39 AM on May 11, 2020: none

    nice idea. any update?

  12. DrahtBot locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-22 18:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me