Skip to content

Commit

Permalink
remove redundant comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Wondertan committed Aug 2, 2023
1 parent 8a1be0a commit 1caf196
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions blockservice/blockservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,7 @@ func (s *blockService) AddBlock(ctx context.Context, o blocks.Block) error {
defer span.End()

c := o.Cid()
// hash security
err := verifcid.ValidateCid(s.allowlist, c)
err := verifcid.ValidateCid(s.allowlist, c) // hash security
if err != nil {
return err
}
Expand Down Expand Up @@ -308,7 +307,7 @@ func (s *blockService) GetBlocks(ctx context.Context, ks []cid.Cid) <-chan block
f = s.getExchange
}

return getBlocks(ctx, ks, s.blockstore, s.allowlist, f) // hash security
return getBlocks(ctx, ks, s.blockstore, s.allowlist, f)
}

func getBlocks(ctx context.Context, ks []cid.Cid, bs blockstore.Blockstore, allowlist verifcid.Allowlist, fget func() notifiableFetcher) <-chan blocks.Block {
Expand Down Expand Up @@ -475,15 +474,15 @@ func (s *Session) GetBlock(ctx context.Context, c cid.Cid) (blocks.Block, error)
ctx, span := internal.StartSpan(ctx, "Session.GetBlock", trace.WithAttributes(attribute.Stringer("CID", c)))
defer span.End()

return getBlock(ctx, c, s.bs, s.allowlist, s.getFetcherFactory()) // hash security
return getBlock(ctx, c, s.bs, s.allowlist, s.getFetcherFactory())
}

// GetBlocks gets blocks in the context of a request session
func (s *Session) GetBlocks(ctx context.Context, ks []cid.Cid) <-chan blocks.Block {
ctx, span := internal.StartSpan(ctx, "Session.GetBlocks")
defer span.End()

return getBlocks(ctx, ks, s.bs, s.allowlist, s.getFetcherFactory()) // hash security
return getBlocks(ctx, ks, s.bs, s.allowlist, s.getFetcherFactory())
}

var _ BlockGetter = (*Session)(nil)

0 comments on commit 1caf196

Please sign in to comment.