Skip to content

Commit

Permalink
log block and meta offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
n8maninger committed Nov 20, 2023
1 parent 9c6b9c9 commit 54873c2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sia/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@ func (bs *RenterdBlockStore) Has(ctx context.Context, c cid.Cid) (bool, error) {

// Get returns a block by CID
func (bs *RenterdBlockStore) Get(ctx context.Context, c cid.Cid) (blocks.Block, error) {
bs.log.Debug("get block", zap.String("cid", c.Hash().B58String()))
cm, err := bs.store.GetBlock(ctx, c)
if errors.Is(err, ErrNotFound) {
return nil, format.ErrNotFound{Cid: c}
} else if err != nil {
return nil, fmt.Errorf("failed to get cid: %w", err)
}

bs.log.Debug("get block", zap.String("cid", c.Hash().B58String()), zap.Uint64("blockSize", cm.Data.BlockSize), zap.Uint64("blockOffset", cm.Data.Offset), zap.Uint64("metadataSize", cm.Metadata.Length), zap.Uint64("metadataOffset", cm.Metadata.Offset))

errCh := make(chan error, 2)
defer close(errCh)

Expand Down

0 comments on commit 54873c2

Please sign in to comment.