mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 13:16:42 +00:00
if port is empty string, no listening
This commit is contained in:
parent
4757aa0c2e
commit
d82df7e30f
1 changed files with 9 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue