diff --git a/parity/blockchain.rs b/parity/blockchain.rs index 75a589d68..0baeb1354 100644 --- a/parity/blockchain.rs +++ b/parity/blockchain.rs @@ -165,6 +165,9 @@ fn execute_import(cmd: ImportBlockchain) -> Result { Arc::new(Miner::with_spec(&spec)), ).map_err(|e| format!("Client service error: {:?}", e))); + // free up the spec in memory. + drop(spec); + panic_handler.forward_from(&service); let client = service.client(); @@ -312,6 +315,8 @@ fn execute_export(cmd: ExportBlockchain) -> Result { Arc::new(Miner::with_spec(&spec)), ).map_err(|e| format!("Client service error: {:?}", e))); + drop(spec); + panic_handler.forward_from(&service); let client = service.client(); diff --git a/parity/run.rs b/parity/run.rs index 9fdd811de..9041ede01 100644 --- a/parity/run.rs +++ b/parity/run.rs @@ -235,6 +235,9 @@ pub fn execute(cmd: RunCmd, logger: Arc) -> Result<(), String> { miner.clone(), ).map_err(|e| format!("Client service error: {:?}", e))); + // drop the spec to free up genesis state. + drop(spec); + // forward panics from service panic_handler.forward_from(&service); diff --git a/parity/snapshot.rs b/parity/snapshot.rs index 872e4ba5e..d8323084d 100644 --- a/parity/snapshot.rs +++ b/parity/snapshot.rs @@ -183,7 +183,6 @@ impl SnapshotCommand { Ok((service, panic_handler)) } - /// restore from a snapshot pub fn restore(self) -> Result<(), String> { let file = self.file_path.clone();