mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-01-07 19:50:34 +00:00
Merge pull request #1185 from nspcc-dev/fix-panic-on-shutdown-2.x
network: copy peers for Shutdown iteration
This commit is contained in:
commit
38c195fea9
1 changed files with 1 additions and 1 deletions
|
@ -191,7 +191,7 @@ func (s *Server) Shutdown() {
|
||||||
s.log.Info("shutting down server", zap.Int("peers", s.PeerCount()))
|
s.log.Info("shutting down server", zap.Int("peers", s.PeerCount()))
|
||||||
s.transport.Close()
|
s.transport.Close()
|
||||||
s.discovery.Close()
|
s.discovery.Close()
|
||||||
for p := range s.peers {
|
for p := range s.Peers() {
|
||||||
p.Disconnect(errServerShutdown)
|
p.Disconnect(errServerShutdown)
|
||||||
}
|
}
|
||||||
s.bQueue.discard()
|
s.bQueue.discard()
|
||||||
|
|
Loading…
Reference in a new issue