aboutsummaryrefslogtreecommitdiffstats
path: root/eth/backend.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-05-04 22:35:49 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-05-07 20:30:56 +0800
commit4d5a719f256d7dfbaab2cc9c632cd7996067508f (patch)
treed4841e10035f4fd557ef09f2f4c2f478dc3bf762 /eth/backend.go
parentaf932177755f5f839ab29b16dc490d3e1bb3708d (diff)
downloadgo-tangerine-4d5a719f256d7dfbaab2cc9c632cd7996067508f.tar
go-tangerine-4d5a719f256d7dfbaab2cc9c632cd7996067508f.tar.gz
go-tangerine-4d5a719f256d7dfbaab2cc9c632cd7996067508f.tar.bz2
go-tangerine-4d5a719f256d7dfbaab2cc9c632cd7996067508f.tar.lz
go-tangerine-4d5a719f256d7dfbaab2cc9c632cd7996067508f.tar.xz
go-tangerine-4d5a719f256d7dfbaab2cc9c632cd7996067508f.tar.zst
go-tangerine-4d5a719f256d7dfbaab2cc9c632cd7996067508f.zip
cmd, eth, p2p: introduce pending peer cli arg, add tests
Diffstat (limited to 'eth/backend.go')
-rw-r--r--eth/backend.go26
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