if port is empty string, no listening

This commit is contained in:
zelig 2015-01-02 18:54:59 +00:00
parent acc8ff3079
commit c610c53a9e

View file

@ -86,12 +86,15 @@ func New(db ethutil.Database, identity p2p.ClientIdentity, keyManager *crypto.Ke
protocols := []p2p.Protocol{ethProto, eth.whisper.Protocol()}
server := &p2p.Server{
Identity: identity,
MaxPeers: maxPeers,
Protocols: protocols,
ListenAddr: ":" + port,
Blacklist: eth.blacklist,
NAT: nat,
Identity: identity,
MaxPeers: maxPeers,
Protocols: protocols,
Blacklist: eth.blacklist,
NAT: nat,
}
if len(port) > 0 {
server.ListenAddr = ":" + port
}
eth.server = server