提交 f25893e3 作者: 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: 's avatarBrian Tiger Chow <brian@perfmode.com>
上级 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 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论