diff --git a/zebrad/src/components/inbound.rs b/zebrad/src/components/inbound.rs index d4233df8..cb81e0a4 100644 --- a/zebrad/src/components/inbound.rs +++ b/zebrad/src/components/inbound.rs @@ -62,7 +62,7 @@ pub struct Inbound { address_book: Option>>, state: State, verifier: Verifier, - downloads: Option>, + downloads: Option>>>, } impl Inbound { @@ -102,11 +102,11 @@ impl Service for Inbound { self.outbound = Some(outbound); self.address_book = Some(address_book); self.network_setup = None; - self.downloads = Some(Downloads::new( + self.downloads = Some(Box::pin(Downloads::new( self.outbound.clone().unwrap(), self.verifier.clone(), self.state.clone(), - )); + ))); } Err(TryRecvError::Empty) => { self.network_setup = Some(rx); @@ -123,8 +123,7 @@ impl Service for Inbound { // Clean up completed download tasks if let Some(downloads) = self.downloads.as_mut() { - let downloads = Pin::new(downloads); - while let Poll::Ready(Some(_)) = downloads.poll_next(cx) {} + while let Poll::Ready(Some(_)) = downloads.as_mut().poll_next(cx) {} } // Now report readiness based on readiness of the inner services, if they're available. diff --git a/zebrad/src/components/inbound/downloads.rs b/zebrad/src/components/inbound/downloads.rs index 136c2959..3f82f51c 100644 --- a/zebrad/src/components/inbound/downloads.rs +++ b/zebrad/src/components/inbound/downloads.rs @@ -5,7 +5,6 @@ use std::{ task::{Context, Poll}, }; -use color_eyre::eyre::{eyre, Report}; use futures::{ future::TryFutureExt, ready, @@ -27,11 +26,11 @@ type BoxError = Box; #[derive(Debug)] pub struct Downloads where - ZN: Service + Send + 'static, + ZN: Service + Send + Clone + 'static, ZN::Future: Send, ZV: Service, Response = block::Hash, Error = BoxError> + Send + Clone + 'static, ZV::Future: Send, - ZS: Service + Send + 'static, + ZS: Service + Send + Clone + 'static, ZS::Future: Send, { network: ZN, @@ -44,11 +43,11 @@ where impl Stream for Downloads where - ZN: Service + Send + 'static, + ZN: Service + Send + Clone + 'static, ZN::Future: Send, ZV: Service, Response = block::Hash, Error = BoxError> + Send + Clone + 'static, ZV::Future: Send, - ZS: Service + Send + 'static, + ZS: Service + Send + Clone + 'static, ZS::Future: Send, { type Item = Result;