dirvote.c: maxunmeasurdbw is misspelled

Have a look at this (from dirvote.c, in networkstatus_compute_consensus)

  {
    if (consensus_method < MIN_METHOD_FOR_CORRECT_BWWEIGHTSCALE) {
      max_unmeasured_bw_kb = (int32_t) extract_param_buggy(
                  params, "maxunmeasuredbw", DEFAULT_MAX_UNMEASURED_BW_KB);
    } else {
      max_unmeasured_bw_kb = dirvote_get_intermediate_param_value(
                  param_list, "maxunmeasurdbw", DEFAULT_MAX_UNMEASURED_BW_KB);
      if (max_unmeasured_bw_kb < 1)
        max_unmeasured_bw_kb = 1;
    }
  }

See the problem? In the first case, we are checking an option called "maxunmeasuredbw". In the second case, we are checking "maxunmeasurdbw".

Here it is in monospace:

  • maxunmeasuredbw
  • maxunmeasurdbw

Whooops! I must have introduced this bug back in nickm/tor@fb3704b4, which went into 0.4.6.1-alpha.

I see two fixes:

  1. Document the current behavior in dir-spec and param-spec. If HTTP can fix the spelling of "referer", we can leave this as-is.
  2. Add a new consensus method to fix the spelling.
  3. Go into a corner and curse general state of computing.

I favor option 1.

Found while working on #40835 (closed).