if port is empty string, no listening

This commit is contained in:
zelig 2015-01-02 18:54:59 +00:00
parent 4757aa0c2e
commit d82df7e30f

View file

@ -145,11 +145,14 @@ func New(config *Config) (*Ethereum, error) {
Identity: clientId,
MaxPeers: config.MaxPeers,
Protocols: protocols,
ListenAddr: ":" + config.Port,
Blacklist: eth.blacklist,
NAT: nat,
}
if len(config.Port) > 0 {
eth.net.ListenAddr = ":" + config.Port
}
return eth, nil
}