Skip to content

Commit

Permalink
Explain fuzz initial values.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZmnSCPxj committed Feb 24, 2018
1 parent e684348 commit f0c4e46
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lightningd/gossip_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,11 @@ static void json_getroute(struct command *cmd, const char *buffer, const jsmntok
u64 msatoshi;
unsigned cltv = 9;
double riskfactor;
/* Higher fuzz means that some high-fee paths can be discounted
* for an even larger value, increasing the scope for route
* randomization (the higher-fee paths become more likely to
* be selected) at the cost of increasing the probability of
* selecting the higher-fee paths. */
double fuzz = 75.0;
u8 *seed = tal_arrz(cmd, u8, sizeof(struct siphash_seed));

Expand Down
8 changes: 8 additions & 0 deletions lightningd/payalgo.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,14 @@ static void json_pay(struct command *cmd,

pay->getroute_tries = 0;
pay->sendpay_tries = 0;
/* Higher fuzz increases the potential fees we will pay, since
* higher fuzz makes it more likely that high-fee paths get
* selected. We start with very high fuzz, but if the
* returned route is too expensive for the given
* `maxfeepercent` we reduce the fuzz. Starting with high
* fuzz means, if the user allows high fee, we can take
* advantage of that to increase randomization and
* improve privacy somewhat. */
pay->fuzz = 0.75;
pay->try_parent = NULL;

Expand Down

0 comments on commit f0c4e46

Please sign in to comment.