block manager: avoid incorrect data_dir configs and avoid losing files

This commit is contained in:
Alex Auvolat
2023-09-06 17:49:30 +02:00
parent e30865984a
commit f38a31b330
2 changed files with 44 additions and 5 deletions
+6 -2
View File
@@ -279,16 +279,20 @@ impl BlockManager {
let res = match res {
Ok(res) => res,
Err(e) => {
debug!("Get block {:?}: node {:?} returned error: {}", hash, node, e);
debug!("Get block {:?}: node {:?} could not be contacted: {}", hash, node, e);
continue;
}
};
let (header, stream) = match res.into_parts() {
(Ok(BlockRpc::PutBlock { hash: _, header }), Some(stream)) => (header, stream),
_ => {
(Ok(_), _) => {
debug!("Get block {:?}: node {:?} returned a malformed response", hash, node);
continue;
}
(Err(e), _) => {
debug!("Get block {:?}: node {:?} returned error: {}", hash, node, e);
continue;
}
};
match f(header, stream).await {
Ok(ret) => return Ok(ret),