eth, p2p: start the p2p server even if maxpeers == 0

This commit is contained in:
Péter Szilágyi 2015-05-26 17:49:37 +03:00
parent eae0927597
commit 278183c7e7
2 changed files with 3 additions and 10 deletions

View File

@ -449,14 +449,10 @@ func (s *Ethereum) Start() error {
ClientString: s.net.Name,
ProtocolVersion: ProtocolVersion,
})
if s.net.MaxPeers > 0 {
err := s.net.Start()
if err != nil {
return err
}
}
// periodically flush databases
go s.syncDatabases()

View File

@ -275,9 +275,6 @@ 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 {
return fmt.Errorf("Server.MaxPeers must be > 0")
}
if srv.newTransport == nil {
srv.newTransport = newRLPX
}