···2020 BadRecord(Box<dyn Error>),
2121 #[error("The Commit block reference by the root was not found")]
2222 MissingCommit,
2323+ #[error("The MST block {0} could not be found")]
2424+ MissingBlock(Cid),
2325 #[error("Failed to walk the mst tree: {0}")]
2426 Tripped(#[from] Trip),
2527 #[error("Not finished walking, but no more blocks are available to continue")]
···145147 }
146148 };
147149148148- let mut found_any = false;
149150 // load blocks until we reach that cid
150151 while let Some((cid, data)) = vehicle
151152 .block_stream
···153154 .await
154155 .map_err(|e| DriveError::CarBlockError(e.into()))?
155156 {
156156- found_any = true;
157157 let val = if Node::could_be(&data) {
158158 MaybeProcessedBlock::Raw(data)
159159 } else {
···166166 }
167167 };
168168169169- if !found_any {
170170- panic!("walker unfinished but no more blocks to load");
171171- }
169169+ return Err(DriveError::MissingBlock(cid_needed));
172170 }
173173-174174- // pause to let macos activity monitor's memory stat update, definitely the best way to do this
175175- // tokio::time::sleep(std::time::Duration::from_secs(30)).await;
176171}