aboutsummaryrefslogtreecommitdiff
path: root/src/util/time.c
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2021-02-23 22:30:15 +0100
committerMartin Schanzenbach <mschanzenbach@posteo.de>2021-02-23 22:30:15 +0100
commit64c18a74e38a1cb74042d14a4211622a3bde3bee (patch)
tree8cd226c21f2e40902e252139196998f00445d726 /src/util/time.c
parentd528f6cfbe5e99a7e50e28d76b90654ecb955d9a (diff)
downloadgnunet-64c18a74e38a1cb74042d14a4211622a3bde3bee.tar.gz
gnunet-64c18a74e38a1cb74042d14a4211622a3bde3bee.zip
-flurry of bugfixes for tng service
Diffstat (limited to 'src/util/time.c')
-rw-r--r--src/util/time.c4
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,
809struct GNUNET_TIME_Relative 809struct GNUNET_TIME_Relative
810GNUNET_TIME_randomize (struct GNUNET_TIME_Relative r) 810GNUNET_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}