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

pull/1108/head
Péter Szilágyi 10 years ago
parent eae0927597
commit 278183c7e7
  1. 10
      eth/backend.go
  2. 3
      p2p/server.go

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

@ -275,9 +275,6 @@ func (srv *Server) Start() (err error) {
if srv.PrivateKey == nil { if srv.PrivateKey == nil {
return fmt.Errorf("Server.PrivateKey must be set to a non-nil key") 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 { if srv.newTransport == nil {
srv.newTransport = newRLPX srv.newTransport = newRLPX
} }

Loading…
Cancel
Save