提交 fdf4423c 作者: Jeromy

fix race introduced in bitswap

License: MIT
Signed-off-by: 's avatarJeromy <jeromyj@gmail.com>
上级 498e927a
......@@ -228,14 +228,14 @@ func (bs *Bitswap) HasBlock(ctx context.Context, blk *blocks.Block) error {
default:
}
bs.notifications.Publish(blk)
err := bs.tryPutBlock(blk, 4) // attempt to store block up to four times
if err != nil {
log.Errorf("Error writing block to datastore: %s", err)
return err
}
bs.notifications.Publish(blk)
select {
case bs.newBlocks <- blk:
// send block off to be reprovided
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论