Background task manager #332

Merged
lx merged 35 commits from background-task-manager into main 2022-07-08 11:30:32 +00:00
Showing only changes of commit 4312623930 - Show all commits

View file

@ -415,11 +415,6 @@ impl BlockStoreIterator {
ReadingDir::Pending(_) => unreachable!(), ReadingDir::Pending(_) => unreachable!(),
}; };
if *pos >= subpaths.len() {
self.path.pop();
continue;
}
let data_dir_ent = match subpaths.get(*pos) { let data_dir_ent = match subpaths.get(*pos) {
None => { None => {
self.path.pop(); self.path.pop();
@ -444,15 +439,12 @@ impl BlockStoreIterator {
let path = data_dir_ent.path(); let path = data_dir_ent.path();
self.path.push(ReadingDir::Pending(path)); self.path.push(ReadingDir::Pending(path));
} else if name.len() == 64 { } else if name.len() == 64 {
let hash_bytes = if let Ok(h) = hex::decode(&name) { if let Ok(h) = hex::decode(&name) {
h
} else {
continue;
};
let mut hash = [0u8; 32]; let mut hash = [0u8; 32];
hash.copy_from_slice(&hash_bytes[..]); hash.copy_from_slice(&h);
return Ok(Some(hash.into())); return Ok(Some(hash.into()));
} }
} }
} }
} }
}