Commit f25893e3 authored by Brian Tiger Chow's avatar Brian Tiger Chow

style(net) rm unused error

having an error return value makes the interface a bit confusing to
use. Just ponder... What would an error returned from a predicate
function mean?

License: MIT
Signed-off-by: default avatarBrian Tiger Chow <brian@perfmode.com>
parent 422d3429
......@@ -27,7 +27,7 @@ type Network interface {
ClosePeer(peer.Peer) error
// IsConnected returns whether a connection to given peer exists.
IsConnected(peer.Peer) (bool, error)
IsConnected(peer.Peer) bool
// GetProtocols returns the protocols registered in the network.
GetProtocols() *mux.ProtocolMap
......
......@@ -75,8 +75,8 @@ func (n *IpfsNetwork) ClosePeer(p peer.Peer) error {
}
// IsConnected returns whether a connection to given peer exists.
func (n *IpfsNetwork) IsConnected(p peer.Peer) (bool, error) {
return n.swarm.GetConnection(p.ID()) != nil, nil
func (n *IpfsNetwork) IsConnected(p peer.Peer) bool {
return n.swarm.GetConnection(p.ID()) != nil
}
// GetProtocols returns the protocols registered in the network.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment