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

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