Skip to content

Commit

Permalink
Merge pull request ipfs/go-blockservice#10 from songjiayang/master
Browse files Browse the repository at this point in the history
make blockservice AddBlocks return more quickly

This commit was moved from ipfs/go-blockservice@2c867f6
  • Loading branch information
Stebalien committed May 24, 2019
2 parents ff7a103 + f7a75ea commit a13f5d6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions blockservice/blockservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ func (s *blockService) AddBlocks(bs []blocks.Block) error {
toput = bs
}

if len(toput) == 0 {
return nil
}

err := s.blockstore.PutMany(toput)
if err != nil {
return err
Expand Down

0 comments on commit a13f5d6

Please sign in to comment.