Skip to content

Commit

Permalink
move AttachEmitter block inside nil check (ethereum-optimism#12144)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiqiangxu authored Sep 26, 2024
1 parent 4680790 commit 4a608f6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions op-node/rollup/event/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,13 @@ func (s *Sys) Register(name string, deriver Deriver, opts *RegisterOpts) Emitter
}
})
}
// If it can emit, attach an emitter to it
if attachTo, ok := deriver.(AttachEmitter); ok {
attachTo.AttachEmitter(em)
}

// If it can derive, add it to the executor (and only after attaching the emitter)
if deriver != nil {
// If it can emit, attach an emitter to it
if attachTo, ok := deriver.(AttachEmitter); ok {
attachTo.AttachEmitter(em)
}
r.leaveExecutor = s.executor.Add(r, &opts.Executor)
}
return em
Expand Down

0 comments on commit 4a608f6

Please sign in to comment.