From c9e9e008d5bae867857fc3a01eaf78f63959c80c Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Tue, 10 Sep 2013 09:59:28 +0000 Subject: [PATCH] only solve on request: - if we have a new request - if we have an address for the peer --- src/ats/gnunet-service-ats-solver_mlp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ats/gnunet-service-ats-solver_mlp.c b/src/ats/gnunet-service-ats-solver_mlp.c index c2873a4f6..2d8ac1c79 100644 --- a/src/ats/gnunet-service-ats-solver_mlp.c +++ b/src/ats/gnunet-service-ats-solver_mlp.c @@ -1531,9 +1531,11 @@ GAS_mlp_get_preferred_address (void *solver, /* Added new peer, we have to rebuild problem before solving */ mlp->mlp_prob_changed = GNUNET_YES; + + if ((GNUNET_YES == mlp->mlp_auto_solve) && + (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains(mlp->addresses, &peer->hashPubKey))) + GAS_mlp_solve_problem (mlp); } - if (GNUNET_YES == mlp->mlp_auto_solve) - GAS_mlp_solve_problem (mlp); /* Get prefered address */ GNUNET_CONTAINER_multihashmap_get_multiple (mlp->addresses, &peer->hashPubKey, -- 2.25.1