Commit 2b60b641 authored by Brian Tiger Chow's avatar Brian Tiger Chow Committed by 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: default avatarBrian Tiger Chow <brian@perfmode.com>
parent 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 is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment