(ctx *cli.Context, cfg *p2p.Config)
| 104 | } |
| 105 | |
| 106 | func updateP2pConfig(ctx *cli.Context, cfg *p2p.Config) { |
| 107 | // max peers |
| 108 | if ctx.IsSet(flags.MaxPeersFlagName) { |
| 109 | cfg.MaxPeers = ctx.Int(flags.MaxPeersFlagName) |
| 110 | } |
| 111 | // max pending peers |
| 112 | if ctx.IsSet(flags.MaxPendingPeersFlagName) { |
| 113 | cfg.MaxPendingPeers = ctx.Int(flags.MaxPendingPeersFlagName) |
| 114 | } |
| 115 | // port |
| 116 | if ctx.IsSet(flags.PortFlagName) { |
| 117 | cfg.ListenAddr = fmt.Sprintf(":%d", ctx.Int(flags.PortFlagName)) |
| 118 | } |
| 119 | |
| 120 | if isRunningChain { |
| 121 | updateBootstrapNodes(ctx, cfg) |
| 122 | updateValidatorNodes(ctx) |
| 123 | } |
| 124 | updateNodeKey(ctx, cfg) |
| 125 | } |
| 126 | |
| 127 | // updateBootstrapNodes creates a list of bootstrap nodes from the command line |
| 128 | // flags, reverting to pre-configured ones if none have been specified. |
no test coverage detected