From 7b0ed77579a5decb5328666754663e4ed3ff875f Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Fri, 7 Jun 2024 07:43:23 -0500 Subject: [PATCH] GH-135 Verify lock timestamp before update --- libraries/chain/finality/finalizer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/chain/finality/finalizer.cpp b/libraries/chain/finality/finalizer.cpp index 0c06e96c16..25c236fa47 100644 --- a/libraries/chain/finality/finalizer.cpp +++ b/libraries/chain/finality/finalizer.cpp @@ -89,7 +89,7 @@ finalizer::vote_result finalizer::decide_vote(const block_state_ptr& bsp) { // finalizer has voted strong on bsp, update finalizer safety info if more recent than the current lock bool finalizer::maybe_update_fsi(const block_state_ptr& bsp) { auto& final_on_strong_qc_block_ref = bsp->core.get_block_reference(bsp->core.final_on_strong_qc_block_num); - if (final_on_strong_qc_block_ref.timestamp > fsi.lock.timestamp) { + if (final_on_strong_qc_block_ref.timestamp > fsi.lock.timestamp && bsp->timestamp() > fsi.last_vote.timestamp) { fsi.lock = { final_on_strong_qc_block_ref.block_id, final_on_strong_qc_block_ref.timestamp }; fsi.last_vote = { bsp->id(), bsp->timestamp() }; fsi.last_vote_range_start = bsp->core.latest_qc_block_timestamp();