expose bad block cache reasons through api/cli

This commit is contained in:
whyrusleeping
2020-02-11 23:44:55 -08:00
parent 0661a1bbfc
commit 243b295559
5 changed files with 55 additions and 0 deletions
+9
View File
@@ -88,3 +88,12 @@ func (a *SyncAPI) SyncMarkBad(ctx context.Context, bcid cid.Cid) error {
a.Syncer.MarkBad(bcid)
return nil
}
func (a *SyncAPI) SyncCheckBad(ctx context.Context, bcid cid.Cid) (string, error) {
reason, ok := a.Syncer.CheckBadBlockCache(bcid)
if !ok {
return "", nil
}
return reason, nil
}