gossipd: fix riskfactor passing.

We used a u16, and a 1000 multiplier, which meant we wrapped at
riskfactor 66.  We also never undid the multiplier, so we ended up
applying 1000x the riskfactor they specified.

This changes us to pass the riskfactor with a 1M multiplier.  The next
patch changes the definition of riskfactor to be more useful.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2019-02-01 16:23:38 +10:30
committed by Christian Decker
parent 706debf3d4
commit 662bb0c565
3 changed files with 7 additions and 5 deletions

View File

@@ -352,7 +352,8 @@ static struct command_result *json_getroute(struct command *cmd,
}
u8 *req = towire_gossip_getroute_request(cmd, source, destination,
*msatoshi, *riskfactor * 1000,
*msatoshi,
*riskfactor * 1000000.0,
*cltv, fuzz,
excluded,
*max_hops);