From 5e768d5cb98ef8bae1b76c30610dfe21f17a3fda Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Thu, 30 Jun 2022 21:46:21 -0400 Subject: [PATCH] we were sorting our pqueue the wrong way i.e. we were putting higher effort intro2 cells at the *end* --- src/feature/hs/hs_circuit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/feature/hs/hs_circuit.c b/src/feature/hs/hs_circuit.c index 719e19eded..0c71443879 100644 --- a/src/feature/hs/hs_circuit.c +++ b/src/feature/hs/hs_circuit.c @@ -616,12 +616,12 @@ cleanup_on_free_client_circ(circuit_t *circ) } /** Return less than 0 if a precedes b, 0 if a equals b and greater than 0 if - * b precedes a. */ + * b precedes a. Note that *higher* effort is *earlier* in the pqueue. */ static int compare_rend_request_by_effort_(const void *_a, const void *_b) { const pending_rend_t *a = _a, *b = _b; - if (a->rdv_data.pow_effort < b->rdv_data.pow_effort) { + if (a->rdv_data.pow_effort > b->rdv_data.pow_effort) { return -1; } else if (a->rdv_data.pow_effort == b->rdv_data.pow_effort) { return 0;