mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 12:46:44 +00:00
if port is empty string, no listening
This commit is contained in:
parent
acc8ff3079
commit
c610c53a9e
1 changed files with 9 additions and 6 deletions
|
|
@ -89,11 +89,14 @@ func New(db ethutil.Database, identity p2p.ClientIdentity, keyManager *crypto.Ke
|
||||||
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
|
||||||
|
|
||||||
return eth, nil
|
return eth, nil
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue