Merge pull request #3460 from ethcore/drop-spec

drop spec when no longer useful
This commit is contained in:
Gav Wood 2016-11-16 11:20:13 +08:00 committed by GitHub
commit 8ad2526826
3 changed files with 8 additions and 1 deletions

View File

@ -165,6 +165,9 @@ fn execute_import(cmd: ImportBlockchain) -> Result<String, String> {
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<String, String> {
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();

View File

@ -235,6 +235,9 @@ pub fn execute(cmd: RunCmd, logger: Arc<RotatingLogger>) -> 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);

View File

@ -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();