mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-03 20:32:14 +08:00
error out swarm filter when no daemon is online
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user