Skip to content

Commit f7a75ea

Browse files
committed
make blockservice AddBlocks return more quickly
This commit was moved from ipfs/go-blockservice@1332536
1 parent ca3fd35 commit f7a75ea

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
@@ -181,6 +181,10 @@ func (s *blockService) AddBlocks(bs []blocks.Block) error {
181181
toput = bs
182182
}
183183

184+
if len(toput) == 0 {
185+
return nil
186+
}
187+
184188
err := s.blockstore.PutMany(toput)
185189
if err != nil {
186190
return err

0 commit comments

Comments
 (0)