Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions p2p/nat/nat.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,8 @@ func (n *autodisc) String() string {
defer n.mu.Unlock()
if n.found == nil {
return n.what
} else {
return n.found.String()
}
return n.found.String()
}

// wait blocks until auto-discovery has been performed.
Expand Down
9 changes: 3 additions & 6 deletions p2p/simulations/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,8 @@ func (net *Network) getNodeIDs(excludeIDs []enode.ID) []enode.ID {
if len(excludeIDs) > 0 {
// Return the difference of nodeIDs and excludeIDs
return filterIDs(nodeIDs, excludeIDs)
} else {
return nodeIDs
}
return nodeIDs
}

// GetNodes returns the existing nodes.
Expand All @@ -472,9 +471,8 @@ func (net *Network) getNodes(excludeIDs []enode.ID) []*Node {
if len(excludeIDs) > 0 {
nodeIDs := net.getNodeIDs(excludeIDs)
return net.getNodesByID(nodeIDs)
} else {
return net.Nodes
}
return net.Nodes
}

// GetNodesByID returns existing nodes with the given enode.IDs.
Expand Down Expand Up @@ -1098,7 +1096,6 @@ func (net *Network) executeNodeEvent(e *Event) error {
func (net *Network) executeConnEvent(e *Event) error {
if e.Conn.Up {
return net.Connect(e.Conn.One, e.Conn.Other)
} else {
return net.Disconnect(e.Conn.One, e.Conn.Other)
}
return net.Disconnect(e.Conn.One, e.Conn.Other)
}
Loading