Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit 2c867f6

Browse files
authored
Merge pull request #10 from songjiayang/master
make blockservice AddBlocks return more quickly
2 parents b46b687 + 1332536 commit 2c867f6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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)