Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Lock reports to avoid out of order badness. #721

Merged
merged 3 commits into from
Mar 14, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions parity/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -608,13 +608,15 @@ impl Informant {
let chain_info = client.chain_info();
let queue_info = client.queue_info();
let cache_info = client.blockchain_cache_info();
let report = client.report();
let sync_info = sync.status();

let mut write_report = self.report.write().unwrap();
let report = client.report();

if let (_, _, &Some(ref last_report)) = (
self.chain_info.read().unwrap().deref(),
self.cache_info.read().unwrap().deref(),
self.report.read().unwrap().deref()
write_report.deref()
) {
println!("[ #{} {} ]---[ {} blk/s | {} tx/s | {} gas/s //··· {}/{} peers, #{}, {}+{} queued ···// mem: {} db, {} chain, {} queue, {} sync ]",
chain_info.best_block_number,
Expand All @@ -638,7 +640,7 @@ impl Informant {

*self.chain_info.write().unwrap().deref_mut() = Some(chain_info);
*self.cache_info.write().unwrap().deref_mut() = Some(cache_info);
*self.report.write().unwrap().deref_mut() = Some(report);
*write_report.deref_mut() = Some(report);
}
}

Expand Down