提交 e8d825de 作者: Jeromy

error out swarm filter when no daemon is online

License: MIT
Signed-off-by: 's avatarJeromy <jeromyj@gmail.com>
上级 f6f9cae4
......@@ -392,6 +392,11 @@ Filters default to those specified under the "Swarm.AddrFilters" config key.
return
}
if n.PeerHost == nil {
res.SetError(errNotOnline, cmds.ErrNormal)
return
}
snet, ok := n.PeerHost.Network().(*swarm.Network)
if !ok {
res.SetError(errors.New("failed to cast network to swarm network"), cmds.ErrNormal)
......@@ -434,6 +439,11 @@ add your filters to the ipfs config file.
return
}
if n.PeerHost == nil {
res.SetError(errNotOnline, cmds.ErrNormal)
return
}
snet, ok := n.PeerHost.Network().(*swarm.Network)
if !ok {
res.SetError(errors.New("failed to cast network to swarm network"), cmds.ErrNormal)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论