Skip to content

Commit

Permalink
add comment about defer in eth/handler.go
Browse files Browse the repository at this point in the history
  • Loading branch information
alecps committed Aug 8, 2024
1 parent e0fc697 commit 4c028a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eth/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ func (h *handler) l2MigrationLoop() {
block := event.Block
if h.chain.Config().IsL2Migration(block.Number()) {
log.Info("L2 Migration Block Reached, stopping handler and p2p server", "block", block.NumberU64(), "hash", block.Hash())
h.wg.Done()
h.wg.Done() // we don't use 'defer' here because we want to decrement the wait group before calling h.Stop(), otherwise we get a deadlock
h.Stop()
h.server.Stop()
return
Expand Down

0 comments on commit 4c028a8

Please sign in to comment.