This commit is contained in:
Łukasz Magiera 2021-01-10 22:54:21 +01:00
parent 9e74c3c4e8
commit 5462ecf6da
2 changed files with 12 additions and 6 deletions

View File

@ -142,7 +142,10 @@ func (sb *Sealer) AddPiece(ctx context.Context, sector storage.SectorRef, existi
break
}
done := make(chan struct{cid.Cid; error}, 1)
done := make(chan struct {
cid.Cid
error
}, 1)
pbuf := <-throttle
copy(pbuf, buf[:read])
@ -152,7 +155,10 @@ func (sb *Sealer) AddPiece(ctx context.Context, sector storage.SectorRef, existi
}()
c, err := sb.pieceCid(sector.ProofType, pbuf[:read])
done <- struct {cid.Cid; error }{c, err}
done <- struct {
cid.Cid
error
}{c, err}
}(read)
piecePromises = append(piecePromises, func() (abi.PieceInfo, error) {

View File

@ -4,7 +4,6 @@ import (
"bytes"
"context"
"fmt"
"github.com/filecoin-project/lotus/extern/storage-sealing/lib/nullreader"
"io"
"io/ioutil"
"math/rand"
@ -34,6 +33,7 @@ import (
"github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper/basicfs"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
"github.com/filecoin-project/lotus/extern/storage-sealing/lib/nullreader"
)
func init() {