limit number of allowed connections per ip

This commit is contained in:
Ethan Buchman
2015-07-11 01:41:08 +00:00
parent d0610845dc
commit 555dab4fd6
4 changed files with 21 additions and 7 deletions

View File

@@ -35,8 +35,6 @@ func NewPeerSet() *PeerSet {
}
// Returns false if peer with key (uuid) is already in set.
// TODO: we may want to do other things like restrict how many peers
// we're willing to connect to behind a single IP
func (ps *PeerSet) Add(peer *Peer) bool {
ps.mtx.Lock()
defer ps.mtx.Unlock()