Skip to content

Commit

Permalink
Stop using approx_time() in circuitmux_ewma.
Browse files Browse the repository at this point in the history
It doesn't match with the tick-count code any longer.

Bug not in any released Tor.
  • Loading branch information
nmathewson committed May 1, 2018
1 parent 5c5392f commit 60fad8d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/or/circuitmux_ewma.c
Expand Up @@ -250,7 +250,11 @@ static unsigned current_tick_num;
static inline unsigned int
cell_ewma_get_tick(void)
{
return ((unsigned)approx_time() / EWMA_TICK_LEN);
monotime_coarse_t now;
monotime_coarse_get(&now);
int32_t msec_diff = monotime_coarse_diff_msec32(&start_of_current_tick,
&now);
return current_tick_num + msec_diff / (1000*EWMA_TICK_LEN);
}

/**
Expand Down

0 comments on commit 60fad8d

Please sign in to comment.