@@ -115,9 +115,8 @@ fd_tower_lockout_check( fd_tower_t const * tower,
115
115
fd_tower_vote_t const * vote = fd_tower_votes_peek_index_const ( tower , cnt - 1 );
116
116
fd_ghost_ele_t const * root = fd_ghost_root_const ( ghost );
117
117
118
- int lockout_check = slot <= vote -> slot ||
119
- vote -> slot < root -> slot ||
120
- fd_ghost_is_ancestor ( ghost , fd_ghost_hash ( ghost , vote -> slot ), block_id );
118
+ int lockout_check = (slot > vote -> slot ) &&
119
+ (vote -> slot < root -> slot || fd_ghost_is_ancestor ( ghost , fd_ghost_hash ( ghost , vote -> slot ), block_id ));
121
120
FD_LOG_NOTICE (( "[fd_tower_lockout_check] ok? %d. top: (slot: %lu, conf: %lu). switch: %lu." , lockout_check , vote -> slot , vote -> conf , slot ));
122
121
return lockout_check ;
123
122
}
@@ -356,7 +355,7 @@ fd_tower_vote_slot( fd_tower_t * tower,
356
355
/* The ghost head is on the same fork as our last vote slot, so we
357
356
can vote fork it as long as we pass the threshold check. */
358
357
359
- if ( FD_LIKELY ( fd_tower_threshold_check ( tower , epoch , funk , txn , head -> slot , scratch ) ) ) {
358
+ if ( FD_LIKELY ( head -> slot > vote -> slot && fd_tower_threshold_check ( tower , epoch , funk , txn , head -> slot , scratch ) ) ) {
360
359
FD_LOG_DEBUG (( "[%s] success (threshold). best: %lu. vote: (slot: %lu conf: %lu)" , __func__ , head -> slot , vote -> slot , vote -> conf ));
361
360
return head -> slot ;
362
361
}
0 commit comments