diff --git a/zebrad/src/components/sync.rs b/zebrad/src/components/sync.rs index ff36bc6c..55078762 100644 --- a/zebrad/src/components/sync.rs +++ b/zebrad/src/components/sync.rs @@ -18,7 +18,7 @@ use zebra_chain::{ use zebra_network as zn; use zebra_state as zs; -use crate::config::ZebradConfig; +use crate::{config::ZebradConfig, BoxError}; mod downloads; use downloads::{AlwaysHedge, Downloads}; @@ -114,8 +114,6 @@ pub(super) const BLOCK_VERIFY_TIMEOUT: Duration = Duration::from_secs(180); /// previous sync runs. const SYNC_RESTART_DELAY: Duration = Duration::from_secs(61); -type BoxError = Box; - /// Helps work around defects in the bitcoin protocol by checking whether /// the returned hashes actually extend a chain tip. #[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)] diff --git a/zebrad/src/lib.rs b/zebrad/src/lib.rs index 19a432f0..64944fba 100644 --- a/zebrad/src/lib.rs +++ b/zebrad/src/lib.rs @@ -26,6 +26,13 @@ #[macro_use] extern crate tracing; +/// Error type alias to make working with tower traits easier. +/// +/// Note: the 'static lifetime bound means that the *type* cannot have any +/// non-'static lifetimes, (e.g., when a type contains a borrow and is +/// parameterized by 'a), *not* that the object itself has 'static lifetime. +pub type BoxError = Box; + mod components; pub mod application;