Skip to content

Commit

Permalink
Rename HasBlock to NotifyNewBlocks, and make it accept multiple blocks
Browse files Browse the repository at this point in the history
The goal here is twofold:
- allows for batched handling of multiple blocks at once
- act as a noisy signal for the breaking change that Bitswap is not adding blocks in the blockstore itself anymore (see ipfs/go-bitswap#571)
  • Loading branch information
MichaelMure committed Jul 13, 2022
1 parent da62575 commit 1786a28
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ import (
type Interface interface { // type Exchanger interface
Fetcher

// TODO Should callers be concerned with whether the block was made
// available on the network?
HasBlock(context.Context, blocks.Block) error
// NotifyNewBlocks tells the exchange that new blocks are available and can be served.
NotifyNewBlocks(ctx context.Context, blocks ...blocks.Block) error

IsOnline() bool

Expand Down

0 comments on commit 1786a28

Please sign in to comment.