- remove adjust
[oweals/gnunet.git] / src / experimentation / gnunet-daemon-experimentation_scheduler.c
index 34142fabb9016d3498fc7872dc07d9cd5b5cf09b..c13434e9be88c4bda8bffd31d7e7ad2602da39c0 100644 (file)
@@ -25,7 +25,6 @@
  * @author Matthias Wachs
  */
 #include "platform.h"
-#include "gnunet_getopt_lib.h"
 #include "gnunet_util_lib.h"
 #include "gnunet_core_service.h"
 #include "gnunet_statistics_service.h"
@@ -227,21 +226,20 @@ static void run_experiment_outbound (void *cls,const struct GNUNET_SCHEDULER_Tas
 void
 GED_scheduler_handle_start (struct Node *n, struct Experiment *e)
 {
-       struct ScheduledExperiment *se;
-
-       if ((NULL != (se = find_experiment (waiting_in_head, waiting_in_tail, n, e, GNUNET_NO))) ||
-                (NULL != (se = find_experiment (running_in_head, running_in_tail, n, e, GNUNET_NO))))
-       {
-               GNUNET_break_op (0);
-               return;
-       }
-
-       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received %s message from peer %s for experiment `%s'\n",
-                       "START", GNUNET_i2s (&n->id), e->name);
-
-       GED_scheduler_add (n, e, GNUNET_NO);
+  if ((NULL != find_experiment (waiting_in_head, waiting_in_tail, n, e, GNUNET_NO)) ||
+      (NULL != find_experiment (running_in_head, running_in_tail, n, e, GNUNET_NO)))
+  {
+    GNUNET_break_op (0);
+    return;
+  }
+
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Received %s message from peer %s for experiment `%s'\n",
+             "START", GNUNET_i2s (&n->id), e->name);
+  GED_scheduler_add (n, e, GNUNET_NO);
 }
 
+
 /**
  * Handle a START_ACK message from a remote node
  *
@@ -332,7 +330,7 @@ GED_scheduler_add (struct Node *n, struct Experiment *e, int outbound)
                        return; /* End of experiment is reached */
 
        /* Add additional checks here if required */
-       se = GNUNET_malloc (sizeof (struct ScheduledExperiment));
+       se = GNUNET_new (struct ScheduledExperiment);
        se->state = NOT_RUNNING;
        se->outbound = outbound;
        se->e = e;