Skip to content
  • George Kadianakis's avatar
    Fix time source bug in sr_state_get_start_time_of_current_protocol_run(). · 9e6235d2
    George Kadianakis authored and Nick Mathewson's avatar Nick Mathewson committed
    The following bug was causing many issues for this branch in chutney:
    
    In sr_state_get_start_time_of_current_protocol_run() we were using the
    consensus valid-after to calculate beginning_of_current_round, but we were
    using time(NULL) to calculate the current_round slot. This was causing time
    sync issues when the consensus valid-after and time(NULL) were disagreeing on
    what the current round is. Our fix is to use the consensus valid-after in both
    places.
    
    This also means that we are not using 'now' (aka time(NULL)) anymore in that
    function, and hence we can remove that argument from the function (and its
    callers). I'll do this in the next commit so that we keep things separated.
    
    Furthermore, we fix a unittest that broke.
    9e6235d2