From 5181a2a9b115a5da65b2b6858cdc3db17bbea732 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Wed, 6 Feb 2019 12:46:33 -0800 Subject: [PATCH] Guard against invalid tick heights --- src/last_id_queue.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/last_id_queue.rs b/src/last_id_queue.rs index 80acaee4aa..4242fc4356 100644 --- a/src/last_id_queue.rs +++ b/src/last_id_queue.rs @@ -103,7 +103,9 @@ impl LastIdQueue { let current_tick_height = self.tick_height; let mut total = 0; for (tick_height, stake) in ticks_and_stakes.iter() { - if ((current_tick_height - tick_height) as usize) < MAX_ENTRY_IDS { + if current_tick_height >= *tick_height + && ((current_tick_height - tick_height) as usize) < MAX_ENTRY_IDS + { total += stake; if total > supermajority_stake { return self.tick_height_to_timestamp(*tick_height);