Skip to content

Commit a13f5d6

Browse files
authored
Merge pull request ipfs/go-blockservice#10 from songjiayang/master
make blockservice AddBlocks return more quickly This commit was moved from ipfs/go-blockservice@2c867f6
2 parents ff7a103 + f7a75ea commit a13f5d6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

blockservice/blockservice.go

+4
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ func (s *blockService) AddBlocks(bs []blocks.Block) error {
178178
toput = bs
179179
}
180180

181+
if len(toput) == 0 {
182+
return nil
183+
}
184+
181185
err := s.blockstore.PutMany(toput)
182186
if err != nil {
183187
return err

0 commit comments

Comments
 (0)