mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-23 11:27:42 +08:00
fix: check blockstore before adding task
addresses https://github.com/jbenet/go-ipfs/pull/438#discussion_r21953742 License: MIT Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
This commit is contained in:
parent
6e7c46a6e2
commit
2b60b641c4
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user