Skip to content

Commit

Permalink
GH-135 Verify lock timestamp before update
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Jun 7, 2024
1 parent 456ae2c commit 7b0ed77
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/chain/finality/finalizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 7b0ed77

Please sign in to comment.