Skip to content

Commit

Permalink
blockchain: TimeSource is required.
Browse files Browse the repository at this point in the history
  • Loading branch information
dajohi committed Jan 12, 2017
1 parent 7c0fd83 commit 406ddd1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions blockchain/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1683,6 +1683,9 @@ func New(config *Config) (*BlockChain, error) {
if config.ChainParams == nil {
return nil, AssertError("blockchain.New chain parameters nil")
}
if config.TimeSource == nil {
return nil, AssertError("blockchain.New timesource is nil")
}

// Generate a checkpoint by height map from the provided checkpoints.
params := config.ChainParams
Expand Down
1 change: 1 addition & 0 deletions cmd/findcheckpoint/findcheckpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ func main() {
chain, err := blockchain.New(&blockchain.Config{
DB: db,
ChainParams: activeNetParams,
TimeSource: blockchain.NewMedianTime(),
})
if err != nil {
fmt.Fprintf(os.Stderr, "failed to initialize chain: %v\n", err)
Expand Down

0 comments on commit 406ddd1

Please sign in to comment.