Merge pull request #3460 from ethcore/drop-spec
drop spec when no longer useful
This commit is contained in:
commit
8ad2526826
@ -165,6 +165,9 @@ fn execute_import(cmd: ImportBlockchain) -> Result<String, String> {
|
|||||||
Arc::new(Miner::with_spec(&spec)),
|
Arc::new(Miner::with_spec(&spec)),
|
||||||
).map_err(|e| format!("Client service error: {:?}", e)));
|
).map_err(|e| format!("Client service error: {:?}", e)));
|
||||||
|
|
||||||
|
// free up the spec in memory.
|
||||||
|
drop(spec);
|
||||||
|
|
||||||
panic_handler.forward_from(&service);
|
panic_handler.forward_from(&service);
|
||||||
let client = service.client();
|
let client = service.client();
|
||||||
|
|
||||||
@ -312,6 +315,8 @@ fn execute_export(cmd: ExportBlockchain) -> Result<String, String> {
|
|||||||
Arc::new(Miner::with_spec(&spec)),
|
Arc::new(Miner::with_spec(&spec)),
|
||||||
).map_err(|e| format!("Client service error: {:?}", e)));
|
).map_err(|e| format!("Client service error: {:?}", e)));
|
||||||
|
|
||||||
|
drop(spec);
|
||||||
|
|
||||||
panic_handler.forward_from(&service);
|
panic_handler.forward_from(&service);
|
||||||
let client = service.client();
|
let client = service.client();
|
||||||
|
|
||||||
|
@ -235,6 +235,9 @@ pub fn execute(cmd: RunCmd, logger: Arc<RotatingLogger>) -> Result<(), String> {
|
|||||||
miner.clone(),
|
miner.clone(),
|
||||||
).map_err(|e| format!("Client service error: {:?}", e)));
|
).map_err(|e| format!("Client service error: {:?}", e)));
|
||||||
|
|
||||||
|
// drop the spec to free up genesis state.
|
||||||
|
drop(spec);
|
||||||
|
|
||||||
// forward panics from service
|
// forward panics from service
|
||||||
panic_handler.forward_from(&service);
|
panic_handler.forward_from(&service);
|
||||||
|
|
||||||
|
@ -183,7 +183,6 @@ impl SnapshotCommand {
|
|||||||
|
|
||||||
Ok((service, panic_handler))
|
Ok((service, panic_handler))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// restore from a snapshot
|
/// restore from a snapshot
|
||||||
pub fn restore(self) -> Result<(), String> {
|
pub fn restore(self) -> Result<(), String> {
|
||||||
let file = self.file_path.clone();
|
let file = self.file_path.clone();
|
||||||
|
Loading…
Reference in New Issue
Block a user