diff --git a/zebrad/src/components/sync.rs b/zebrad/src/components/sync.rs index a9362d6a6..d6a26c59d 100644 --- a/zebrad/src/components/sync.rs +++ b/zebrad/src/components/sync.rs @@ -97,6 +97,9 @@ const TIPS_RETRY_TIMEOUT: Duration = Duration::from_secs(60); /// networks, and on testnet, which has a small number of slow peers. const SYNC_RESTART_TIMEOUT: Duration = Duration::from_secs(100); +type BoxError = Box; +type ReportAndHash = (Report, block::Hash); + /// 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)] @@ -108,11 +111,11 @@ struct CheckedTip { #[derive(Debug)] pub struct ChainSync where - ZN: Service + Send + Clone + 'static, + ZN: Service + Send + Clone + 'static, ZN::Future: Send, - ZS: Service + Send + Clone + 'static, + ZS: Service + Send + Clone + 'static, ZS::Future: Send, - ZV: Service, Response = block::Hash, Error = Error> + Send + Clone + 'static, + ZV: Service, Response = block::Hash, Error = BoxError> + Send + Clone + 'static, ZV::Future: Send, { /// Used to perform ObtainTips and ExtendTips requests, with no retry logic @@ -135,11 +138,11 @@ where /// diffusion. impl ChainSync where - ZN: Service + Send + Clone + 'static, + ZN: Service + Send + Clone + 'static, ZN::Future: Send, - ZS: Service + Send + Clone + 'static, + ZS: Service + Send + Clone + 'static, ZS::Future: Send, - ZV: Service, Response = block::Hash, Error = Error> + Send + Clone + 'static, + ZV: Service, Response = block::Hash, Error = BoxError> + Send + Clone + 'static, ZV::Future: Send, { /// Returns a new syncer instance, using: @@ -676,9 +679,6 @@ where } } -type Error = Box; -type ReportAndHash = (Report, block::Hash); - #[cfg(test)] mod test { use super::*;