Skip to content

Commit

Permalink
Make shutdown safer
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasstevens89 committed Mar 31, 2020
1 parent 0bf5e6c commit e42fd23
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion electrum/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,9 @@ func (s *Server) request(method string, params []interface{}, v interface{}) err
}

func (s *Server) Shutdown() {
close(s.quit)
if !s.IsShutdown() {
close(s.quit)
}
if s.transport != nil {
_ = s.transport.Close()
}
Expand Down

0 comments on commit e42fd23

Please sign in to comment.