mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 01:13:45 +00:00
p2p, cmd/utils: remove DiscoveryV5Addr
This commit is contained in:
parent
c9a1981292
commit
9a61c871a4
6 changed files with 4 additions and 20 deletions
|
|
@ -223,7 +223,6 @@ func newFaucet(genesis *core.Genesis, port int, enodes []*discv5.Node, network u
|
|||
NoDiscovery: true,
|
||||
DiscoveryV5: true,
|
||||
ListenAddr: fmt.Sprintf(":%d", port),
|
||||
DiscoveryV5Addr: fmt.Sprintf(":%d", port+1),
|
||||
MaxPeers: 25,
|
||||
BootstrapNodesV5: enodes,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -635,14 +635,6 @@ func setListenAddress(ctx *cli.Context, cfg *p2p.Config) {
|
|||
}
|
||||
}
|
||||
|
||||
// setDiscoveryV5Address creates a UDP listening address string from set command
|
||||
// line flags for the V5 discovery protocol.
|
||||
func setDiscoveryV5Address(ctx *cli.Context, cfg *p2p.Config) {
|
||||
if ctx.GlobalIsSet(ListenPortFlag.Name) {
|
||||
cfg.DiscoveryV5Addr = fmt.Sprintf(":%d", ctx.GlobalInt(ListenPortFlag.Name)+1)
|
||||
}
|
||||
}
|
||||
|
||||
// setNAT creates a port mapper from command line flags.
|
||||
func setNAT(ctx *cli.Context, cfg *p2p.Config) {
|
||||
if ctx.GlobalIsSet(NATFlag.Name) {
|
||||
|
|
@ -793,7 +785,6 @@ func SetP2PConfig(ctx *cli.Context, cfg *p2p.Config) {
|
|||
setNodeKey(ctx, cfg)
|
||||
setNAT(ctx, cfg)
|
||||
setListenAddress(ctx, cfg)
|
||||
setDiscoveryV5Address(ctx, cfg)
|
||||
setBootstrapNodes(ctx, cfg)
|
||||
setBootstrapNodesV5(ctx, cfg)
|
||||
|
||||
|
|
@ -829,7 +820,6 @@ func SetP2PConfig(ctx *cli.Context, cfg *p2p.Config) {
|
|||
// --dev mode can't use p2p networking.
|
||||
cfg.MaxPeers = 0
|
||||
cfg.ListenAddr = ":0"
|
||||
cfg.DiscoveryV5Addr = ":0"
|
||||
cfg.NoDiscovery = true
|
||||
cfg.DiscoveryV5 = false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,7 +116,6 @@ func NewNode(datadir string, config *NodeConfig) (stack *Node, _ error) {
|
|||
P2P: p2p.Config{
|
||||
NoDiscovery: true,
|
||||
DiscoveryV5: true,
|
||||
DiscoveryV5Addr: ":0",
|
||||
BootstrapNodesV5: config.BootstrapNodes.nodes,
|
||||
ListenAddr: ":0",
|
||||
NAT: nat.Any(),
|
||||
|
|
|
|||
|
|
@ -41,10 +41,9 @@ var DefaultConfig = Config{
|
|||
WSPort: DefaultWSPort,
|
||||
WSModules: []string{"net", "web3"},
|
||||
P2P: p2p.Config{
|
||||
ListenAddr: ":30303",
|
||||
DiscoveryV5Addr: ":30304",
|
||||
MaxPeers: 25,
|
||||
NAT: nat.Any(),
|
||||
ListenAddr: ":30303",
|
||||
MaxPeers: 25,
|
||||
NAT: nat.Any(),
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -643,7 +643,7 @@ func (s *ticketStore) gotTopicNodes(from *Node, hash common.Hash, nodes []rpcNod
|
|||
if ip.IsUnspecified() || ip.IsLoopback() {
|
||||
ip = from.IP
|
||||
}
|
||||
n := NewNode(node.ID, ip, node.UDP-1, node.TCP-1) // subtract one from port while discv5 is running in test mode on UDPport+1
|
||||
n := NewNode(node.ID, ip, node.UDP, node.TCP)
|
||||
select {
|
||||
case chn <- n:
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -78,9 +78,6 @@ type Config struct {
|
|||
// protocol should be started or not.
|
||||
DiscoveryV5 bool `toml:",omitempty"`
|
||||
|
||||
// Listener address for the V5 discovery protocol UDP traffic.
|
||||
DiscoveryV5Addr string `toml:",omitempty"`
|
||||
|
||||
// Name sets the node name of this server.
|
||||
// Use common.MakeName to create a name that follows existing conventions.
|
||||
Name string `toml:"-"`
|
||||
|
|
|
|||
Loading…
Reference in a new issue