Skip to content

Commit

Permalink
fix: memory leak issue with diff protocol (#1019)
Browse files Browse the repository at this point in the history
  • Loading branch information
j75689 committed Jul 26, 2022
1 parent cd46de9 commit dd3b3a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions eth/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ func (h *handler) runDiffExtension(peer *diff.Peer, handler diff.Handler) error

if err := h.peers.registerDiffExtension(peer); err != nil {
peer.Log().Error("Diff extension registration failed", "err", err)
peer.Close()
return err
}
return handler(peer)
Expand Down
1 change: 1 addition & 0 deletions eth/handler_diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func (h *diffHandler) RunPeer(peer *diff.Peer, hand diff.Handler) error {
wait <- peer
}
ps.lock.Unlock()
peer.Close()
return err
}
return (*handler)(h).runDiffExtension(peer, hand)
Expand Down

0 comments on commit dd3b3a6

Please sign in to comment.