add command for power users to manually update sector state

This commit is contained in:
whyrusleeping
2019-12-04 20:43:54 -08:00
parent a45fe8a7f9
commit 40be53c9f9
5 changed files with 71 additions and 5 deletions
+10 -5
View File
@@ -3,6 +3,12 @@ package impl
import (
"context"
"encoding/json"
"io"
"mime"
"net/http"
"os"
"path/filepath"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/chain/address"
"github.com/filecoin-project/lotus/lib/sectorbuilder"
@@ -12,11 +18,6 @@ import (
"github.com/filecoin-project/lotus/storage/sectorblocks"
"github.com/gorilla/mux"
files "github.com/ipfs/go-ipfs-files"
"io"
"mime"
"net/http"
"os"
"path/filepath"
)
type StorageMinerAPI struct {
@@ -201,6 +202,10 @@ func (sm *StorageMinerAPI) SectorsRefs(context.Context) (map[string][]api.Sealed
return out, nil
}
func (sm *StorageMinerAPI) SectorsUpdate(ctx context.Context, id uint64, state api.SectorState) error {
return sm.Miner.UpdateSectorState(ctx, id, state)
}
func (sm *StorageMinerAPI) WorkerQueue(ctx context.Context) (<-chan sectorbuilder.WorkerTask, error) {
return sm.SectorBuilder.AddWorker(ctx)
}