diff --git a/zebrad/src/application.rs b/zebrad/src/application.rs index 9ddc5214..60ede1e9 100644 --- a/zebrad/src/application.rs +++ b/zebrad/src/application.rs @@ -161,9 +161,15 @@ impl Application for ZebradApp { .issue_filter(|kind| match kind { color_eyre::ErrorKind::NonRecoverable(_) => true, color_eyre::ErrorKind::Recoverable(error) => { - !error.is::() - && !error.is::() - && !error.to_string().contains("timed out") + // type checks should be faster than string conversions + if error.is::() + || error.is::() + { + return false; + } + + let error_str = error.to_string(); + !error_str.contains("timed out") && !error_str.contains("duplicate hash") } }); diff --git a/zebrad/src/components/sync/downloads.rs b/zebrad/src/components/sync/downloads.rs index ca59abd7..bc1e5b7d 100644 --- a/zebrad/src/components/sync/downloads.rs +++ b/zebrad/src/components/sync/downloads.rs @@ -113,7 +113,7 @@ where #[instrument(level = "debug", skip(self), fields(%hash))] pub async fn download_and_verify(&mut self, hash: block::Hash) -> Result<(), Report> { if self.cancel_handles.contains_key(&hash) { - return Err(eyre!("duplicate hash queued for download")); + return Err(eyre!("duplicate hash queued for download: {:?}", hash)); } // We construct the block requests sequentially, waiting for the peer