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

Commit

Permalink
Merge pull request #10 from songjiayang/master
Browse files Browse the repository at this point in the history
make blockservice AddBlocks return more quickly
  • Loading branch information
Stebalien authored May 24, 2019
2 parents b46b687 + 1332536 commit 2c867f6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions 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 2c867f6

Please sign in to comment.