Skip to content

Commit

Permalink
bugfix: reorder the wg.Done and panic catch on defer in handler
Browse files Browse the repository at this point in the history
  • Loading branch information
gameofpointers committed Oct 4, 2024
1 parent 547fd54 commit 9139080
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion quai/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ func (h *handler) checkNextPrimeBlock() {

h.wg.Add(1)
go func() {
defer h.wg.Done()
defer func() {
if r := recover(); r != nil {
h.logger.WithFields(log.Fields{
Expand All @@ -176,6 +175,7 @@ func (h *handler) checkNextPrimeBlock() {
}).Fatal("Go-Quai Panicked")
}
}()
defer h.wg.Done()

if h.ctx.Err() != nil {
return
Expand Down

0 comments on commit 9139080

Please sign in to comment.