diff --git a/service/events.go b/service/events.go index 4b8e9c44..8339b941 100644 --- a/service/events.go +++ b/service/events.go @@ -16,6 +16,9 @@ type NodeEvents struct { } func (nd *NodeEvents) listenHeadChangesOnce(ctx context.Context) error { + ctx, cancel := context.WithCancel(ctx) + defer cancel() + notifs, err := nd.client.ChainNotify(ctx) if err != nil { return err @@ -48,7 +51,7 @@ func (nd *NodeEvents) listenHeadChangesOnce(ctx context.Context) error { } if err := nd.msgService.ProcessNewHead(ctx, apply); err != nil { - return fmt.Errorf("process new head error: %v", err) + nd.log.Errorf("process new head error: %v", err) } } return nil