mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +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
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue