From d82df7e30ffb41f4df2aeeaa97e23e0e0212169f Mon Sep 17 00:00:00 2001 From: zelig Date: Fri, 2 Jan 2015 18:54:59 +0000 Subject: [PATCH] if port is empty string, no listening --- eth/backend.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/eth/backend.go b/eth/backend.go index 393254820b..352316ad54 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -142,12 +142,15 @@ func New(config *Config) (*Ethereum, error) { } eth.net = &p2p.Server{ - Identity: clientId, - MaxPeers: config.MaxPeers, - Protocols: protocols, - ListenAddr: ":" + config.Port, - Blacklist: eth.blacklist, - NAT: nat, + Identity: clientId, + MaxPeers: config.MaxPeers, + Protocols: protocols, + Blacklist: eth.blacklist, + NAT: nat, + } + + if len(config.Port) > 0 { + eth.net.ListenAddr = ":" + config.Port } return eth, nil