Skip to content

Commit 3d97810

Browse files
committed
Don't error on closed exchange
This commit was moved from ipfs/go-blockservice@3d57ac5
1 parent ca3fd35 commit 3d97810

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

blockservice/blockservice.go

+2-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ package blockservice
66
import (
77
"context"
88
"errors"
9-
"fmt"
109
"io"
1110
"sync"
1211

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

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

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

0 commit comments

Comments
 (0)