gofmt
This commit is contained in:
parent
6714240653
commit
433550e9a4
@ -133,7 +133,7 @@ func (m *Miner) HandleDealStream(stream network.Stream) { // TODO: should we blo
|
|||||||
size = uint64(isize)
|
size = uint64(isize)
|
||||||
}
|
}
|
||||||
|
|
||||||
if deal.Unixfs0.Offset + deal.Unixfs0.Size > size {
|
if deal.Unixfs0.Offset+deal.Unixfs0.Size > size {
|
||||||
writeErr(stream, xerrors.Errorf("tried to read too much %d+%d > %d", deal.Unixfs0.Offset, deal.Unixfs0.Size, size))
|
writeErr(stream, xerrors.Errorf("tried to read too much %d+%d > %d", deal.Unixfs0.Offset, deal.Unixfs0.Size, size))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -3,21 +3,21 @@ package storage
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/filecoin-project/go-lotus/build"
|
|
||||||
"github.com/filecoin-project/go-lotus/storage/sector"
|
|
||||||
|
|
||||||
"github.com/filecoin-project/go-lotus/api"
|
|
||||||
"github.com/filecoin-project/go-lotus/chain/actors"
|
|
||||||
"github.com/filecoin-project/go-lotus/chain/address"
|
|
||||||
"github.com/filecoin-project/go-lotus/chain/store"
|
|
||||||
"github.com/filecoin-project/go-lotus/chain/types"
|
|
||||||
"github.com/ipfs/go-cid"
|
"github.com/ipfs/go-cid"
|
||||||
"github.com/ipfs/go-datastore"
|
"github.com/ipfs/go-datastore"
|
||||||
logging "github.com/ipfs/go-log"
|
logging "github.com/ipfs/go-log"
|
||||||
host "github.com/libp2p/go-libp2p-core/host"
|
host "github.com/libp2p/go-libp2p-core/host"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
|
"github.com/filecoin-project/go-lotus/api"
|
||||||
|
"github.com/filecoin-project/go-lotus/build"
|
||||||
|
"github.com/filecoin-project/go-lotus/chain/actors"
|
||||||
|
"github.com/filecoin-project/go-lotus/chain/address"
|
||||||
|
"github.com/filecoin-project/go-lotus/chain/store"
|
||||||
|
"github.com/filecoin-project/go-lotus/chain/types"
|
||||||
"github.com/filecoin-project/go-lotus/lib/sectorbuilder"
|
"github.com/filecoin-project/go-lotus/lib/sectorbuilder"
|
||||||
|
"github.com/filecoin-project/go-lotus/storage/sector"
|
||||||
)
|
)
|
||||||
|
|
||||||
var log = logging.Logger("storageminer")
|
var log = logging.Logger("storageminer")
|
||||||
|
@ -201,4 +201,3 @@ func (st *SectorBlocks) SealedBlockstore(approveUnseal func() error) *SectorBloc
|
|||||||
approveUnseal: approveUnseal,
|
approveUnseal: approveUnseal,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,5 +74,4 @@ func (s *SectorBlockStore) Get(c cid.Cid) (blocks.Block, error) {
|
|||||||
return blocks.NewBlockWithCid(data, c)
|
return blocks.NewBlockWithCid(data, c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var _ blockstore.Blockstore = &SectorBlockStore{}
|
var _ blockstore.Blockstore = &SectorBlockStore{}
|
||||||
|
@ -31,7 +31,7 @@ func (ub *unsealedBlocks) getRef(ctx context.Context, refs []api.SealedRef, appr
|
|||||||
b, ok := ub.unsealed[ref.Piece]
|
b, ok := ub.unsealed[ref.Piece]
|
||||||
if ok {
|
if ok {
|
||||||
ub.lk.Unlock()
|
ub.lk.Unlock()
|
||||||
return b[ref.Offset:ref.Offset + uint64(ref.Size)], nil // TODO: check slice math
|
return b[ref.Offset : ref.Offset+uint64(ref.Size)], nil // TODO: check slice math
|
||||||
}
|
}
|
||||||
// TODO: pick unsealing based on how long it's running (or just select all relevant, usually it'll be just one)
|
// TODO: pick unsealing based on how long it's running (or just select all relevant, usually it'll be just one)
|
||||||
_, ok = ub.unsealing[ref.Piece]
|
_, ok = ub.unsealing[ref.Piece]
|
||||||
@ -48,7 +48,7 @@ func (ub *unsealedBlocks) getRef(ctx context.Context, refs []api.SealedRef, appr
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return b[best.Offset:best.Offset + uint64(best.Size)], nil // TODO: check slice math
|
return b[best.Offset : best.Offset+uint64(best.Size)], nil // TODO: check slice math
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ub *unsealedBlocks) maybeUnseal(ctx context.Context, pieceKey string, approveUnseal func() error) ([]byte, error) {
|
func (ub *unsealedBlocks) maybeUnseal(ctx context.Context, pieceKey string, approveUnseal func() error) ([]byte, error) {
|
||||||
@ -94,5 +94,3 @@ func (ub *unsealedBlocks) maybeUnseal(ctx context.Context, pieceKey string, appr
|
|||||||
close(ub.unsealing[pieceKey])
|
close(ub.unsealing[pieceKey])
|
||||||
return data, nil
|
return data, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user