Limit getheaders to a hard 2000. #951

pull TheBlueMatt wants to merge 1 commits into bitcoin:master from TheBlueMatt:headerslimit changing 1 files +2 −2
  1. TheBlueMatt commented at 4:20 AM on March 19, 2012: member

    Previously getheaders would return any number of headers up to 2000 + the distance the locator parameter was back (which is up to ~ the number of items in the locator ^ 2).

    The only client I was able to find which actually handles the headers message is BitcoinJ, and it clearly expects no more than 2000 headers See: http://code.google.com/p/bitcoinj/source/browse/core/src/main/java/com/google/bitcoin/core/HeadersMessage.java#35

    Additionally, the wiki clearly states that getheaders will only ever return 2000 headers: https://en.bitcoin.it/wiki/Network#Messages

  2. Limit getheaders to a hard 2000.
    Previously getheaders would return any number of headers up to
    2000 + the distance the locator parameter was back (which is up to
    ~ the number of items in the locator ^ 2).
    
    The only client I was able to find which actually handles the headers
    message is BitcoinJ, and it clearly expects no more than 2000 headers
    See:
    http://code.google.com/p/bitcoinj/source/browse/core/src/main/java/com/google/bitcoin/core/HeadersMessage.java#35
    
    Additionally, the wiki clearly states that getheaders will only ever
    return 2000 headers: https://en.bitcoin.it/wiki/Network#Messages
    ecf07f2729
  3. TheBlueMatt commented at 4:32 AM on March 19, 2012: member

    There really is no reason to allow nodes to request all of the headers from where they are in the chain to our max block + 2000...

  4. gavinandresen commented at 4:35 PM on March 22, 2012: contributor

    ACK for 0.7. Not high enough priority for 0.6 IMHO.

  5. mikehearn commented at 8:21 PM on March 27, 2012: contributor

    Looks good to me

  6. gavinandresen referenced this in commit 85ea8b4f43 on Apr 2, 2012
  7. gavinandresen merged this on Apr 2, 2012
  8. gavinandresen closed this on Apr 2, 2012

  9. coblee referenced this in commit b3a41d4b87 on Jul 17, 2012
  10. suprnurd referenced this in commit 3b606b0c63 on Dec 5, 2017
  11. ptschip referenced this in commit a844123c76 on Feb 13, 2018
  12. lateminer referenced this in commit fa40040f80 on Oct 30, 2019
  13. DrahtBot locked this on Sep 8, 2021

Milestone
0.7.0


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-24 15:16 UTC

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