#include "conf_net.h"
#include "conf.h"
#include "connection.h"
+#include "crypto.h"
#include "graph.h"
#include "logger.h"
#include "meta.h"
}
timeout_set(data, &(struct timeval) {
- 1, rand() % 100000
+ 1, jitter()
});
}
if(contradicting_del_edge > 100 && contradicting_add_edge > 100) {
logger(DEBUG_ALWAYS, LOG_WARNING, "Possible node with same Name as us! Sleeping %d seconds.", sleeptime);
- nanosleep(&(struct timespec) {
- sleeptime, 0
- }, NULL);
+ sleep_millis(sleeptime * 1000);
sleeptime *= 2;
if(sleeptime < 0) {
}
timeout_set(data, &(struct timeval) {
- 5, rand() % 100000
+ 5, jitter()
});
}
int main_loop(void) {
last_periodic_run_time = now;
timeout_add(&pingtimer, timeout_handler, &pingtimer, &(struct timeval) {
- pingtimeout, rand() % 100000
+ pingtimeout, jitter()
});
timeout_add(&periodictimer, periodic_handler, &periodictimer, &(struct timeval) {
0, 0