miner: Add slow mode to proving check
This commit is contained in:
+17
-2
@@ -544,8 +544,23 @@ func (sm *StorageMinerAPI) CreateBackup(ctx context.Context, fpath string) error
|
||||
return backup(sm.DS, fpath)
|
||||
}
|
||||
|
||||
func (sm *StorageMinerAPI) CheckProvable(ctx context.Context, pp abi.RegisteredPoStProof, sectors []sto.SectorRef) (map[abi.SectorNumber]string, error) {
|
||||
bad, err := sm.StorageMgr.CheckProvable(ctx, pp, sectors)
|
||||
func (sm *StorageMinerAPI) CheckProvable(ctx context.Context, pp abi.RegisteredPoStProof, sectors []sto.SectorRef, expensive bool) (map[abi.SectorNumber]string, error) {
|
||||
var rg sectorstorage.RGetter
|
||||
if expensive {
|
||||
rg = func(ctx context.Context, id abi.SectorID) (cid.Cid, error) {
|
||||
si, err := sm.Miner.GetSectorInfo(id.Number)
|
||||
if err != nil {
|
||||
return cid.Undef, err
|
||||
}
|
||||
if si.CommR == nil {
|
||||
return cid.Undef, xerrors.Errorf("commr is nil")
|
||||
}
|
||||
|
||||
return *si.CommR, nil
|
||||
}
|
||||
}
|
||||
|
||||
bad, err := sm.StorageMgr.CheckProvable(ctx, pp, sectors, rg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user