Browse Source

actually stop peer on failed Add

pull/116/head
Ethan Buchman 10 years ago
parent
commit
95765db7eb
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      p2p/switch.go

+ 1
- 1
p2p/switch.go View File

@ -224,7 +224,7 @@ func (sw *Switch) AddPeerWithConnection(conn net.Conn, outbound bool) (*Peer, er
// ignore if duplicate or if we already have too many for that IP range
if err := sw.peers.Add(peer); err != nil {
log.Info("Ignoring peer", "error", err, "peer", peer)
peer.stop() // will also close sconn
peer.mconn.Stop()
return nil, err
}


Loading…
Cancel
Save