Branch: refs/heads/master
Home: https://github.com/conformal/btcchain
Commit: 4579cfb71b79ce14d26b7aac67d4a67bbefd2dad
https://github.com/conformal/btcchain/commit/4579cfb71b79ce14d26b7aac67d4a67bbefd2dad
Author: Dave Collins <[email protected]>
Date: 2014-05-27 (Tue, 27 May 2014)
Changed paths:
M accept.go
M blocklocator.go
M chain.go
M checkpoints.go
M common_test.go
M difficulty.go
M doc.go
R params.go
M process.go
M validate.go
M validate_test.go
Log Message:
-----------
Refactor several network-specific params to btcnet.
This commit refactors the code to make use of the btcnet package for
network-specific parameters instead of switching on the specific network.
For example, the percentage of the network that needs to run version 2
blocks is different between testnet and mainnet. Previously the code was
using a switch to choose these values. With this refactor, those
parameters are part of the network parameters provided when creating a new
chain instance.
Another example is checkpoints, which have been moved to btcnet so they
can be specified by the caller instead of hard coded into this package.
As a result, the checkpoints for the standard networks are now specified
in the btcnet package.
This makes it easier to add new networks such as a testnet4 should it
become needed. It also allows callers to define their own custom network
parameters without having to modify the code of the package to add new
switch cases for the custom network.