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 #15 from ipfs/fix/closed-exchg
Browse files Browse the repository at this point in the history
Don't return errors on closed exchange
  • Loading branch information
schomatis authored Jan 20, 2019
2 parents 132f774 + 3d57ac5 commit 95d8898
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions blockservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package blockservice
import (
"context"
"errors"
"fmt"
"io"
"sync"

Expand Down Expand Up @@ -150,8 +149,7 @@ func (s *blockService) AddBlock(o blocks.Block) error {
log.Event(context.TODO(), "BlockService.BlockAdded", c)

if err := s.exchange.HasBlock(o); err != nil {
// TODO(#4623): really an error?
return errors.New("blockservice is closed")
log.Errorf("HasBlock: %s", err.Error())
}

return nil
Expand Down Expand Up @@ -189,8 +187,7 @@ func (s *blockService) AddBlocks(bs []blocks.Block) error {
for _, o := range toput {
log.Event(context.TODO(), "BlockService.BlockAdded", o.Cid())
if err := s.exchange.HasBlock(o); err != nil {
// TODO(#4623): Should this really *return*?
return fmt.Errorf("blockservice is closed (%s)", err)
log.Errorf("HasBlock: %s", err.Error())
}
}
return nil
Expand Down

0 comments on commit 95d8898

Please sign in to comment.