cmd, eth, p2p: introduce pending peer cli arg, add tests

This commit is contained in:
Péter Szilágyi
2015-05-04 17:35:49 +03:00
parent af93217775
commit 4d5a719f25
6 changed files with 170 additions and 19 deletions

View File

@ -197,6 +197,11 @@ var (
Usage: "Maximum number of network peers (network disabled if set to 0)",
Value: 16,
}
MaxPendingPeersFlag = cli.IntFlag{
Name: "maxpendpeers",
Usage: "Maximum number of pending connection attempts (defaults used if set to 0)",
Value: 0,
}
ListenPortFlag = cli.IntFlag{
Name: "port",
Usage: "Network listening port",
@ -286,6 +291,7 @@ func MakeEthConfig(clientID, version string, ctx *cli.Context) *eth.Config {
AccountManager: GetAccountManager(ctx),
VmDebug: ctx.GlobalBool(VMDebugFlag.Name),
MaxPeers: ctx.GlobalInt(MaxPeersFlag.Name),
MaxPendingPeers: ctx.GlobalInt(MaxPendingPeersFlag.Name),
Port: ctx.GlobalString(ListenPortFlag.Name),
NAT: GetNAT(ctx),
NatSpec: ctx.GlobalBool(NatspecEnabledFlag.Name),