Branch: refs/heads/master
Home: https://github.com/conformal/btcchain
Commit: 1676ecd7a6b3ccc3bc75e427b4d6a497e406a198
https://github.com/conformal/btcchain/commit/1676ecd7a6b3ccc3bc75e427b4d6a497e406a198
Author: Dave Collins <[email protected]>
Date: 2014-03-11 (Tue, 11 Mar 2014)
Changed paths:
M chain.go
M test_coverage.txt
M validate.go
M validate_test.go
Log Message:
-----------
Export CheckConnectBlock function.
This commit makes a slight variant of the existing checkConnectBlock
function available to external callers. The new exported version checks
if the passed block will connect to the end of the current main chain.
In order to support this, a few other small modifications have been made
to the initial index generation and the existing checkConnectBlock since
it previously made some assumptions about the state of genesis block which
can no longer be assumed due accepting blocks from callers directly.
Also, add a quick test to ensure the new function fails when checking if
the genesis block will connect again when it's already inserted.