Record a batch of events
This commit is contained in:
parent
d9079de262
commit
77a76f0783
17
src/tpu.rs
17
src/tpu.rs
|
@ -367,20 +367,11 @@ impl Tpu {
|
|||
|
||||
/// Process the transactions in parallel and then log the successful ones.
|
||||
fn process_events(&self, events: Vec<Event>) -> Result<()> {
|
||||
for result in self.acc.lock().unwrap().process_verified_events(events) {
|
||||
if let Ok(event) = result {
|
||||
self.historian_input
|
||||
.lock()
|
||||
.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)?;
|
||||
let results = self.acc.lock().unwrap().process_verified_events(events);
|
||||
let events = results.into_iter().filter_map(|x| x.ok()).collect();
|
||||
let sender = self.historian_input.lock().unwrap();
|
||||
sender.send(Signal::Events(events))?;
|
||||
debug!("after historian_input");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue