diff --git a/parity/run.rs b/parity/run.rs index 98fed7e0d7e..7f6b7db699d 100644 --- a/parity/run.rs +++ b/parity/run.rs @@ -676,11 +676,15 @@ pub fn execute_impl(cmd: RunCmd, can_restart: bool, logger: Arc) let event_loop = EventLoop::spawn(); // the updater service + let mut updater_fetch = fetch.clone(); + // parity binaries should be smaller than 128MB + updater_fetch.set_limit(Some(128 * 1024 * 1024)); + let updater = Updater::new( Arc::downgrade(&(service.client() as Arc)), Arc::downgrade(&sync_provider), update_policy, - fetch.clone(), + updater_fetch, event_loop.remote(), ); service.add_notify(updater.clone()); diff --git a/util/fetch/src/client.rs b/util/fetch/src/client.rs index a24cf991b1a..07c6a162474 100644 --- a/util/fetch/src/client.rs +++ b/util/fetch/src/client.rs @@ -127,6 +127,11 @@ impl Client { }) } + /// Sets a limit on the maximum download size. + pub fn set_limit(&mut self, limit: Option) { + self.limit = limit + } + fn client(&self) -> Result, Error> { { let (ref time, ref client) = *self.client.read(); @@ -150,8 +155,8 @@ impl Fetch for Client { type Result = CpuFuture; fn new() -> Result { - // Max 50MB will be downloaded. - Self::with_limit(Some(50*1024*1024)) + // Max 64MB will be downloaded. + Self::with_limit(Some(64 * 1024 * 1024)) } fn process(&self, f: F) -> BoxFuture where