Merge pull request #1108 from karalabe/fine-seeding
Fine tune seeder and p2p peer handling
This commit is contained in:
@ -72,6 +72,7 @@ type Config struct {
|
||||
|
||||
MaxPeers int
|
||||
MaxPendingPeers int
|
||||
Discovery bool
|
||||
Port string
|
||||
|
||||
// Space-separated list of discovery node URLs
|
||||
@ -311,6 +312,7 @@ func New(config *Config) (*Ethereum, error) {
|
||||
Name: config.Name,
|
||||
MaxPeers: config.MaxPeers,
|
||||
MaxPendingPeers: config.MaxPendingPeers,
|
||||
Discovery: config.Discovery,
|
||||
Protocols: protocols,
|
||||
NAT: config.NAT,
|
||||
NoDial: !config.Dial,
|
||||
@ -449,14 +451,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
|
||||
}
|
||||
err := s.net.Start()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// periodically flush databases
|
||||
go s.syncDatabases()
|
||||
|
||||
|
Reference in New Issue
Block a user