(maxSize int, server *Server)
| 53 | } |
| 54 | |
| 55 | func NewPeerPool(maxSize int, server *Server) *PeerPool { |
| 56 | return &PeerPool{ |
| 57 | maxSize: maxSize, |
| 58 | server: server, |
| 59 | configs: make(map[uint32]*vconfig.PeerConfig), |
| 60 | IDMap: make(map[string]uint32), |
| 61 | P2pMap: make(map[uint32]uint64), |
| 62 | peers: make(map[uint32]*Peer), |
| 63 | peerConnectionWaitings: make(map[uint32]chan struct{}), |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | func (pool *PeerPool) clean() { |
| 68 | pool.lock.Lock() |