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()} protocols := []p2p.Protocol{ethProto, eth.whisper.Protocol()}
server := &p2p.Server{ server := &p2p.Server{
Identity: identity, Identity: identity,
MaxPeers: maxPeers, MaxPeers: maxPeers,
Protocols: protocols, Protocols: protocols,
ListenAddr: ":" + port, Blacklist: eth.blacklist,
Blacklist: eth.blacklist, NAT: nat,
NAT: nat, }
if len(port) > 0 {
server.ListenAddr = ":" + port
} }
eth.server = server eth.server = server