summaryrefslogtreecommitdiff
path: root/client/src/download.rs
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/download.rs')
-rw-r--r--client/src/download.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/client/src/download.rs b/client/src/download.rs
index bc3de09..85cce32 100644
--- a/client/src/download.rs
+++ b/client/src/download.rs
@@ -55,6 +55,11 @@ impl Downloader {
let mut state = self.inner.write().unwrap();
if state.have.contains(&hash) {
state.store.get_raw(hash)
+ } else if state.need.contains(&hash) {
+ Ok(None)
+ } else if let Some(res) = state.store.get_raw(hash)? {
+ state.have.insert(hash);
+ Ok(Some(res))
} else {
state.need.insert(hash);
Ok(None)