From 4d5a719f256d7dfbaab2cc9c632cd7996067508f Mon Sep 17 00:00:00 2001 From: Péter Szilágyi Date: Mon, 4 May 2015 17:35:49 +0300 Subject: cmd, eth, p2p: introduce pending peer cli arg, add tests --- eth/backend.go | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'eth/backend.go') diff --git a/eth/backend.go b/eth/backend.go index 791336d75..0f23cde2f 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -60,8 +60,9 @@ type Config struct { VmDebug bool NatSpec bool - MaxPeers int - Port string + MaxPeers int + MaxPendingPeers int + Port string // Space-separated list of discovery node URLs BootNodes string @@ -280,16 +281,17 @@ func New(config *Config) (*Ethereum, error) { protocols = append(protocols, eth.whisper.Protocol()) } eth.net = &p2p.Server{ - PrivateKey: netprv, - Name: config.Name, - MaxPeers: config.MaxPeers, - Protocols: protocols, - NAT: config.NAT, - NoDial: !config.Dial, - BootstrapNodes: config.parseBootNodes(), - StaticNodes: config.parseNodes(staticNodes), - TrustedNodes: config.parseNodes(trustedNodes), - NodeDatabase: nodeDb, + PrivateKey: netprv, + Name: config.Name, + MaxPeers: config.MaxPeers, + MaxPendingPeers: config.MaxPendingPeers, + Protocols: protocols, + NAT: config.NAT, + NoDial: !config.Dial, + BootstrapNodes: config.parseBootNodes(), + StaticNodes: config.parseNodes(staticNodes), + TrustedNodes: config.parseNodes(trustedNodes), + NodeDatabase: nodeDb, } if len(config.Port) > 0 { eth.net.ListenAddr = ":" + config.Port -- cgit