mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 07:06:42 +00:00
feat: re-enable p2p layer (#152)
This commit is contained in:
parent
ff9405b2fa
commit
346bfc82e8
2 changed files with 7 additions and 7 deletions
|
|
@ -539,7 +539,7 @@ func (s *Ethereum) Start() error {
|
|||
s.startBloomHandlers(params.BloomBitsBlocks)
|
||||
|
||||
// Figure out a max peers count based on the server limits
|
||||
//maxPeers := s.p2pServer.MaxPeers
|
||||
maxPeers := s.p2pServer.MaxPeers
|
||||
//if s.config.LightServ > 0 {
|
||||
// if s.config.LightPeers >= s.p2pServer.MaxPeers {
|
||||
// return fmt.Errorf("invalid peer config: light peer count (%d) >= total peer count (%d)", s.config.LightPeers, s.p2pServer.MaxPeers)
|
||||
|
|
@ -547,7 +547,7 @@ func (s *Ethereum) Start() error {
|
|||
// maxPeers -= s.config.LightPeers
|
||||
//}
|
||||
// Start the networking layer and the light server if requested
|
||||
//s.handler.Start(maxPeers)
|
||||
s.handler.Start(maxPeers)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -557,7 +557,7 @@ func (s *Ethereum) Stop() error {
|
|||
// Stop all the peer-related stuff first.
|
||||
s.ethDialCandidates.Close()
|
||||
s.snapDialCandidates.Close()
|
||||
//s.handler.Stop()
|
||||
s.handler.Stop()
|
||||
|
||||
// Then stop everything else.
|
||||
s.bloomIndexer.Close()
|
||||
|
|
|
|||
|
|
@ -262,15 +262,15 @@ func (n *Node) doClose(errs []error) error {
|
|||
// openEndpoints starts all network and RPC endpoints.
|
||||
func (n *Node) openEndpoints() error {
|
||||
// start networking endpoints
|
||||
/*n.log.Info("Starting peer-to-peer node", "instance", n.server.Name)
|
||||
n.log.Info("Starting peer-to-peer node", "instance", n.server.Name)
|
||||
if err := n.server.Start(); err != nil {
|
||||
return convertFileLockError(err)
|
||||
}*/
|
||||
}
|
||||
// start RPC endpoints
|
||||
err := n.startRPC()
|
||||
if err != nil {
|
||||
n.stopRPC()
|
||||
//n.server.Stop()
|
||||
n.server.Stop()
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
|
@ -299,7 +299,7 @@ func (n *Node) stopServices(running []Lifecycle) error {
|
|||
}
|
||||
|
||||
// Stop p2p networking.
|
||||
//n.server.Stop()
|
||||
n.server.Stop()
|
||||
|
||||
if len(failure.Services) > 0 {
|
||||
return failure
|
||||
|
|
|
|||
Loading…
Reference in a new issue