From 1786a28c67d2a28f623e87c95d78f5ae054169e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Mur=C3=A9?= Date: Wed, 13 Jul 2022 15:55:37 +0200 Subject: [PATCH] Rename HasBlock to NotifyNewBlocks, and make it accept multiple blocks 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 https://github.com/ipfs/go-bitswap/pull/571) --- interface.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/interface.go b/interface.go index 7640c57..0d98750 100644 --- a/interface.go +++ b/interface.go @@ -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