Skip to content

Commit

Permalink
return empty slice if state is nil (#4365)
Browse files Browse the repository at this point in the history
  • Loading branch information
terencechain authored and prestonvanloon committed Dec 29, 2019
1 parent 7f450e5 commit 2b7acdf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions beacon-chain/blockchain/chain_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ func (s *Service) HeadValidatorsIndices(epoch uint64) ([]uint64, error) {

// HeadSeed returns the seed from the head view of a given epoch.
func (s *Service) HeadSeed(epoch uint64) ([32]byte, error) {
if s.headState == nil {
return [32]byte{}, nil
}

return helpers.Seed(s.headState, epoch, params.BeaconConfig().DomainBeaconAttester)
}

Expand Down

0 comments on commit 2b7acdf

Please sign in to comment.