Branch: refs/heads/master
Home: https://github.com/btcsuite/btcd
Commit: 19eae8d8a150bfdc9b8fd3e12ca6148bad4c57cb
https://github.com/btcsuite/btcd/commit/19eae8d8a150bfdc9b8fd3e12ca6148bad4c57cb
Author: Dave Collins <[email protected]>
Date: 2015-05-12 (Tue, 12 May 2015)
Changed paths:
M blockchain/accept.go
M blockchain/validate.go
Log Message:
-----------
blockchain: Split block and header validation.
This commit refactors the consensus rule checks for block headers and
blocks in the blockchain package into separate functions. These changes
contain no modifications to consensus rules and the code still passes all
block consensus tests. It is only a refactoring.
This is being done to help pave the way toward supporting concurrent
downloads. While the package already supports headers-first mode up
through the latest checkpoint through the use of the BFFastAdd flag and
hard-coded checkpoints, it currently only works when downloading from a
single peer. In order to support concurrent downloads from multiple
peers, the ability for the caller to do things such as independently
checking a block header (both context-free and full-context checks) will
be needed.
There are several more changes that will be necessary to support
concurrent downloads as well, such as making the package concurrent safe,
modifying it to make use of the new database API, etc. Those changes are
planned for future commits.