Skip to content

Commit d23650d

Browse files
ZmnSCPxjrustyrussell
authored andcommitted
Explain fuzz initial values.
1 parent 2db6ff9 commit d23650d

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

lightningd/gossip_control.c

+5
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,11 @@ static void json_getroute(struct command *cmd, const char *buffer, const jsmntok
307307
u64 msatoshi;
308308
unsigned cltv = 9;
309309
double riskfactor;
310+
/* Higher fuzz means that some high-fee paths can be discounted
311+
* for an even larger value, increasing the scope for route
312+
* randomization (the higher-fee paths become more likely to
313+
* be selected) at the cost of increasing the probability of
314+
* selecting the higher-fee paths. */
310315
double fuzz = 75.0;
311316
u8 *seed = tal_arrz(cmd, u8, sizeof(struct siphash_seed));
312317

lightningd/payalgo.c

+8
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,14 @@ static void json_pay(struct command *cmd,
356356

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

0 commit comments

Comments
 (0)