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:
Rusty Russell
2016-09-06 16:47:48 +09:30
parent e2bc70bfce
commit ca80fc0286
6 changed files with 60 additions and 12 deletions

View File

@@ -29,6 +29,9 @@ bool json_tok_number(const char *buffer, const jsmntok_t *tok,
bool json_tok_u64(const char *buffer, const jsmntok_t *tok,
uint64_t *num);
/* Extract double from this (must be a number literal) */
bool json_tok_double(const char *buffer, const jsmntok_t *tok, double *num);
/* Extract satoshis from this (may be a string, or a decimal number literal) */
bool json_tok_bitcoin_amount(const char *buffer, const jsmntok_t *tok,
uint64_t *satoshi);