p2p: maxpeers -1 disables the network, maxpeers 0 allowed and means 0 dynamic peers

This commit is contained in:
zelig 2015-05-24 22:39:27 +01:00
parent b06226678e
commit 97ab1abc1b
2 changed files with 2 additions and 2 deletions

View file

@ -476,7 +476,7 @@ func (s *Ethereum) Start() error {
ProtocolVersion: ProtocolVersion,
})
if s.net.MaxPeers > 0 {
if s.net.MaxPeers >= 0 {
err := s.net.Start()
if err != nil {
return err

View file

@ -212,7 +212,7 @@ func (srv *Server) Start() (err error) {
if srv.PrivateKey == nil {
return fmt.Errorf("Server.PrivateKey must be set to a non-nil key")
}
if srv.MaxPeers <= 0 {
if srv.MaxPeers < 0 {
return fmt.Errorf("Server.MaxPeers must be > 0")
}
srv.quit = make(chan struct{})