Limit getheaders to a hard 2000.#951
Merged
gavinandresen merged 1 commit intobitcoin:masterfrom Apr 2, 2012
Merged
Conversation
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
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... |
Contributor
|
ACK for 0.7. Not high enough priority for 0.6 IMHO. |
Contributor
|
Looks good to me |
gavinandresen
added a commit
that referenced
this pull request
Apr 2, 2012
Limit getheaders to a hard 2000.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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