diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-05-08 21:53:40 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-05-08 21:53:40 +0800 |
commit | 23454dcfcb75b9e421d0c3bfe67d33ab49633c5c (patch) | |
tree | 547d6ff40c82f00f1a09e3263c10b7e94c81e45a /eth | |
parent | f819ac715858bd61094e101a199f8e1b79496dbb (diff) | |
parent | 8735e5addda74882da66deab8cf038be1fb3ed3f (diff) | |
download | dexon-23454dcfcb75b9e421d0c3bfe67d33ab49633c5c.tar dexon-23454dcfcb75b9e421d0c3bfe67d33ab49633c5c.tar.gz dexon-23454dcfcb75b9e421d0c3bfe67d33ab49633c5c.tar.bz2 dexon-23454dcfcb75b9e421d0c3bfe67d33ab49633c5c.tar.lz dexon-23454dcfcb75b9e421d0c3bfe67d33ab49633c5c.tar.xz dexon-23454dcfcb75b9e421d0c3bfe67d33ab49633c5c.tar.zst dexon-23454dcfcb75b9e421d0c3bfe67d33ab49633c5c.zip |
Merge pull request #840 from karalabe/throttled-dialing
p2p: throttled handshakes
Diffstat (limited to 'eth')
-rw-r--r-- | eth/backend.go | 26 |
1 files changed, 14 insertions, 12 deletions
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 |