Skip to content

Commit

Permalink
Resolve panic on shutdown with offline eth1 node (#8033)
Browse files Browse the repository at this point in the history
* Resolve panic on shutdown with offline eth1 node

* Move fix tne right place nishant feedback

* fix log message

Co-authored-by: Nishant Das <nishdas93@gmail.com>
  • Loading branch information
shayzluf and nisdas committed Dec 7, 2020
1 parent b51aec6 commit fbbdd94
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion beacon-chain/powchain/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,10 @@ func (s *Service) Start() {
}
go func() {
s.waitForConnection()
if s.ctx.Err() != nil {
log.Info("Context closed, exiting pow goroutine")
return
}
s.run(s.ctx.Done())
}()
}
Expand Down Expand Up @@ -674,7 +678,6 @@ func (s *Service) initPOWService() {
return
default:
ctx := s.ctx

header, err := s.eth1DataFetcher.HeaderByNumber(ctx, nil)
if err != nil {
log.Errorf("Unable to retrieve latest ETH1.0 chain header: %v", err)
Expand Down

0 comments on commit fbbdd94

Please sign in to comment.