Commit 648526d8 authored by Jeromy's avatar Jeromy

make bitswap commands error out properly offline

parent eff73ccc
......@@ -38,6 +38,12 @@ Print out all blocks currently on the bitswap wantlist for the local peer`,
res.SetError(err, cmds.ErrNormal)
return
}
if !nd.OnlineMode() {
res.SetError(errNotOnline, cmds.ErrClient)
return
}
bs, ok := nd.Exchange.(*bitswap.Bitswap)
if !ok {
res.SetError(u.ErrCast(), cmds.ErrNormal)
......@@ -78,6 +84,11 @@ var bitswapStatCmd = &cmds.Command{
return
}
if !nd.OnlineMode() {
res.SetError(errNotOnline, cmds.ErrClient)
return
}
bs, ok := nd.Exchange.(*bitswap.Bitswap)
if !ok {
res.SetError(u.ErrCast(), cmds.ErrNormal)
......
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