Skip to content

Conversation

TheBlueMatt
Copy link
Contributor

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

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
@TheBlueMatt
Copy link
Contributor Author

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...

@gavinandresen
Copy link
Contributor

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

@mikehearn
Copy link
Contributor

Looks good to me

gavinandresen added a commit that referenced this pull request Apr 2, 2012
Limit getheaders to a hard 2000.
@gavinandresen gavinandresen merged commit 85ea8b4 into bitcoin:master Apr 2, 2012
coblee referenced this pull request in litecoin-project/litecoin Jul 17, 2012
Limit getheaders to a hard 2000.
suprnurd pushed a commit to chaincoin-legacy/chaincoin that referenced this pull request Dec 5, 2017
b6b6d6c Added nSuperblockStartBlock, adjusted testnet/regtest params

15a3c64 More for governance block checks, p1 (non-compilable):
    - add GetPaymentsLimit() and GetPaymentsTotalAmount()
    - IsValidBlockHeight() should check nSuperblockStartBlock
    - CSuperblock::IsValid should check payment limit and miner payout
    - no cs_main
    - slightly refactored related things

e8f9e5d More for governance checks, p2 (compilable):
    - IsBlockValueValid(), IsBlockPayeeValid() and FillBlockPayee() rewritten, no cs_main for them
    - CreateNewBlock adjusted, need more work on CBlockTemplate (see TODO)
    - moved (and simplified) IsBlockPayeeValid() call from CheckBlock() to ConnectBlock()

51434cf Add ability to calculate only superblock part of subsidy in GetBlockSubsidy()

aa74200 Fix GetPaymentsLimit()

f7b6234 braces and comment

ade8f64 more checks for IsValidBlockHeight()
ptschip pushed a commit to ptschip/bitcoin that referenced this pull request Feb 13, 2018
Prevent potential integer underflow of nTrimHeight
lateminer pushed a commit to lateminer/bitcoin that referenced this pull request Oct 30, 2019
639b43d [Trivial] Spelling - Wither -> Whether (Cave Spectre)
c9a2cc3 Trivial: typo fixes (Cave Spectre)

Pull request description:

  "monthly" instead of "monthy"
  "budget" instead of "buddget"

  Also included "std::" on the throw runtime_error for a smoother merge with bitcoin#949

ACKs for top commit:
  Fuzzbawls:
    ACK 639b43d

Tree-SHA512: 3e6d72e4842c4e2100e6252b4b452da9368c76583dee9bf7427e73fc1f8115fbcd059bd7869d7f43e9b40f7026a65b07a0d916f6fc9df5f76c93eb08145437dc
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants