Record a batch of events

This commit is contained in:
Greg Fitzgerald 2018-05-09 08:11:19 -06:00
parent d9079de262
commit 77a76f0783
1 changed files with 4 additions and 13 deletions

View File

@ -367,20 +367,11 @@ impl Tpu {
/// Process the transactions in parallel and then log the successful ones. /// Process the transactions in parallel and then log the successful ones.
fn process_events(&self, events: Vec<Event>) -> Result<()> { fn process_events(&self, events: Vec<Event>) -> Result<()> {
for result in self.acc.lock().unwrap().process_verified_events(events) { let results = self.acc.lock().unwrap().process_verified_events(events);
if let Ok(event) = result { let events = results.into_iter().filter_map(|x| x.ok()).collect();
self.historian_input let sender = self.historian_input.lock().unwrap();
.lock() sender.send(Signal::Events(events))?;
.unwrap()
.send(Signal::Event(event))?;
}
}
// Let validators know they should not attempt to process additional
// transactions in parallel.
self.historian_input.lock().unwrap().send(Signal::Tick)?;
debug!("after historian_input"); debug!("after historian_input");
Ok(()) Ok(())
} }