actually set unsealed path in sectorbuilder

This commit is contained in:
Łukasz Magiera 2019-12-01 22:22:03 +01:00
parent fd8f65248b
commit c7cf20843e
3 changed files with 14 additions and 5 deletions

View File

@ -111,9 +111,10 @@ func New(cfg *Config, ds dtypes.MetadataDS) (*SectorBuilder, error) {
ssize: cfg.SectorSize,
lastID: lastUsedID,
stagedDir: cfg.StagedDir,
sealedDir: cfg.SealedDir,
cacheDir: cfg.CacheDir,
stagedDir: cfg.StagedDir,
sealedDir: cfg.SealedDir,
cacheDir: cfg.CacheDir,
unsealedDir: cfg.UnsealedDir,
Miner: cfg.Miner,
rateLimit: make(chan struct{}, cfg.WorkerThreads-PoStReservedWorkers),

View File

@ -41,7 +41,7 @@ func NewMiner(sblks *sectorblocks.SectorBlocks, full api.FullNode) *Miner {
}
func writeErr(stream network.Stream, err error) {
log.Errorf("Retrieval deal error: %s", err)
log.Errorf("Retrieval deal error: %+v", err)
_ = cborutil.WriteCborRPC(stream, &DealResponse{
Status: Error,
Message: err.Error(),

View File

@ -97,8 +97,16 @@ func (s *SectorBlockStore) Get(c cid.Cid) (blocks.Block, error) {
if err != nil {
return nil, xerrors.Errorf("reading block data: %w", err)
}
if uint64(len(data)) != best.Size {
return nil, xerrors.Errorf("got wrong amount of data: %d != !d", len(data), best.Size)
}
return blocks.NewBlockWithCid(data, c)
b, err := blocks.NewBlockWithCid(data, c)
if err != nil {
return nil, xerrors.Errorf("sbs get (%d[%d:%d]): %w", best.SectorID, best.Offset, best.Offset+best.Size, err)
}
return b, nil
}
var _ blockstore.Blockstore = &SectorBlockStore{}