diff options
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/time.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/time.c b/src/util/time.c index 9e41305f1..c1ad5e618 100644 --- a/src/util/time.c +++ b/src/util/time.c | |||
@@ -779,7 +779,7 @@ GNUNET_TIME_year_to_time (unsigned int year) | |||
779 | 779 | ||
780 | /** | 780 | /** |
781 | * Randomized exponential back-off, starting at 1 ms | 781 | * Randomized exponential back-off, starting at 1 ms |
782 | * and going up by a factor of 2+r, where 0 <= r <= 0.5, up | 782 | * and going up by a factor of 2+r, where 0 <= r < 0.5, up |
783 | * to a maximum of the given threshold. | 783 | * to a maximum of the given threshold. |
784 | * | 784 | * |
785 | * @param r current backoff time, initially zero | 785 | * @param r current backoff time, initially zero |
@@ -809,7 +809,7 @@ GNUNET_TIME_randomized_backoff (struct GNUNET_TIME_Relative rt, | |||
809 | struct GNUNET_TIME_Relative | 809 | struct GNUNET_TIME_Relative |
810 | GNUNET_TIME_randomize (struct GNUNET_TIME_Relative r) | 810 | GNUNET_TIME_randomize (struct GNUNET_TIME_Relative r) |
811 | { | 811 | { |
812 | double d = ((rand () % 1001) - 500) / 1000.0; | 812 | double d = ((rand () % 1001) + 500) / 1000.0; |
813 | 813 | ||
814 | return relative_multiply_double (r, d); | 814 | return relative_multiply_double (r, d); |
815 | } | 815 | } |