aboutsummaryrefslogtreecommitdiff
path: root/src/chain.cpp
AgeCommit message (Collapse)Author
2015-11-29Allow block announcements with headersSuhas Daftuar
This replaces using inv messages to announce new blocks, when a peer requests (via the new "sendheaders" message) that blocks be announced with headers instead of inv's. Since headers-first was introduced, peers send getheaders messages in response to an inv, which requires generating a block locator that is large compared to the size of the header being requested, and requires an extra round-trip before a reorg can be relayed. Save time by tracking headers that a peer is likely to know about, and send a headers chain that would connect to a peer's known headers, unless the chain would be too big, in which case we revert to sending an inv instead. Based off of @sipa's commit to announce all blocks in a reorg via inv, which has been squashed into this commit. Rebased-by: Pieter Wuille
2015-05-13Reduce checkpoints' effect on consensus.Pieter Wuille
Instead of only checking height to decide whether to disable script checks, actually check whether a block is an ancestor of a checkpoint, up to which headers have been validated. This means that we don't have to prevent accepting a side branch anymore - it will be safe, just less fast to do. We still need to prevent being fed a multitude of low-difficulty headers filling up our memory. The mechanism for that is unchanged for now: once a checkpoint is reached with headers, no headers chain branching off before that point are allowed anymore.
2014-12-19Added "Core" to copyright headerssandakersmann
Github-Pull: #5494 Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
2014-12-11Move remaining CBlockIndex methods to chain.cppPieter Wuille
2014-10-25Update comments in chain to be doxygen compatibleMichael Ford
2014-10-20Chain::SetTip return type to void21E14
2014-09-29cleanup license and header end comment in chain.cpp/.hPhilip Kaufmann
2014-09-08Move CBlockIndex, CChain and related code out of mainjtimon