提交 2b60b641 作者: Brian Tiger Chow 提交者: Juan Batiz-Benet

fix: check blockstore before adding task

addresses https://github.com/jbenet/go-ipfs/pull/438#discussion_r21953742

License: MIT
Signed-off-by: 's avatarBrian Tiger Chow <brian@perfmode.com>
上级 6e7c46a6
......@@ -122,8 +122,10 @@ func (e *Engine) MessageReceived(p peer.Peer, m bsmsg.BitSwapMessage) error {
e.peerRequestQueue.Remove(entry.Key, p)
} else {
l.Wants(entry.Key, entry.Priority)
newWorkExists = true
e.peerRequestQueue.Push(entry.Key, entry.Priority, p)
if exists, err := e.bs.Has(entry.Key); err == nil && exists {
newWorkExists = true
e.peerRequestQueue.Push(entry.Key, entry.Priority, p)
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论