fix tally_by condition (#234)
This commit is contained in:
parent
4a80690c1f
commit
224a3a53f5
@ -425,15 +425,15 @@ impl<L: UpdateableLeaderSelection, O: Overlay<LeaderSelection = L>> Node for Car
|
|||||||
timeout_qc,
|
timeout_qc,
|
||||||
new_views,
|
new_views,
|
||||||
} => {
|
} => {
|
||||||
let (new, out) = self.engine.approve_new_view(timeout_qc.clone(), new_views);
|
|
||||||
output.push(Output::Send(out));
|
|
||||||
self.engine = new;
|
|
||||||
tracing::info!(
|
tracing::info!(
|
||||||
node = parse_idx(&self.id),
|
node = parse_idx(&self.id),
|
||||||
current_view = self.engine.current_view(),
|
current_view = self.engine.current_view(),
|
||||||
timeout_view = timeout_qc.view,
|
timeout_view = timeout_qc.view,
|
||||||
"receive new view message"
|
"receive new view message"
|
||||||
);
|
);
|
||||||
|
let (new, out) = self.engine.approve_new_view(timeout_qc.clone(), new_views);
|
||||||
|
output.push(Output::Send(out));
|
||||||
|
self.engine = new;
|
||||||
}
|
}
|
||||||
Event::TimeoutQc { timeout_qc } => {
|
Event::TimeoutQc { timeout_qc } => {
|
||||||
tracing::info!(
|
tracing::info!(
|
||||||
|
@ -28,7 +28,7 @@ impl<T: core::hash::Hash + Eq> Tally<T> {
|
|||||||
let entries = self.cache.entry(view).or_default();
|
let entries = self.cache.entry(view).or_default();
|
||||||
entries.insert(message);
|
entries.insert(message);
|
||||||
let entries = entries.len();
|
let entries = entries.len();
|
||||||
if entries >= threshold {
|
if entries == threshold {
|
||||||
Some(self.cache.remove(&view).unwrap())
|
Some(self.cache.remove(&view).unwrap())
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user