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: Brian Tiger Chow <brian@perfmode.com>
Brian Tiger Chow committed
Dec 7, 2014 at 23:58 UTC
f25893e31a1c38d9ff3d61f5083e40978ac0ac0d
2 files changed
+3
-3
net/interface.go
+1
-1
@@ -27,7 +27,7 @@ type Network interface {
27
ClosePeer(peer.Peer) error
28
29
// IsConnected returns whether a connection to given peer exists.
30
- IsConnected(peer.Peer) (bool, error)
30
+ IsConnected(peer.Peer) bool
31
32
// GetProtocols returns the protocols registered in the network.
33
GetProtocols() *mux.ProtocolMap
net/net.go
+2
-2
@@ -75,8 +75,8 @@ func (n *IpfsNetwork) ClosePeer(p peer.Peer) error {
75
}
76
77
// IsConnected returns whether a connection to given peer exists.
78
-func (n *IpfsNetwork) IsConnected(p peer.Peer) (bool, error) {
79
- return n.swarm.GetConnection(p.ID()) != nil, nil
78
+func (n *IpfsNetwork) IsConnected(p peer.Peer) bool {
79
+ return n.swarm.GetConnection(p.ID()) != nil
80
}
81
82
// GetProtocols returns the protocols registered in the network.