mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
getroute: add a risk factor.
We need some way to reflect the tradeoff between the possible delay if a payment gets stuck, and the fees charged by nodes. This adds a risk factor which reflects the probability that a node goes down, and the cost associated with losing access to our funds for a given time. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -64,6 +64,16 @@ bool json_tok_u64(const char *buffer, const jsmntok_t *tok,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool json_tok_double(const char *buffer, const jsmntok_t *tok, double *num)
|
||||
{
|
||||
char *end;
|
||||
|
||||
*num = strtod(buffer + tok->start, &end);
|
||||
if (end != buffer + tok->end)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool json_tok_number(const char *buffer, const jsmntok_t *tok,
|
||||
unsigned int *num)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user