mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd, and uniqueness checks need to happen *after* gossipd replies to avoid a race. For every candidate channel gossipd gives us, we check that it's in state NORMAL (not shutting down, not still waiting for lockin), that it's connected, and that it has capacity. We then choose one with probability weighted by excess capacity, so larger channels are more likely. As a side effect of this, we can tell if an invoice is unpayble (no channels have sufficient incoming capacity) or difficuly (no *online* channels have sufficient capacity), so we add those warnings. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
2f667c5227
commit
c8c3294a23
@@ -102,8 +102,7 @@ enum address_parse_result {
|
||||
/* Return result of address parsing and fills in *scriptpubkey
|
||||
* allocated off ctx if ADDRESS_PARSE_SUCCESS
|
||||
*/
|
||||
enum address_parse_result
|
||||
json_tok_address_scriptpubkey(const tal_t *ctx,
|
||||
enum address_parse_result json_tok_address_scriptpubkey(const tal_t *ctx,
|
||||
const struct chainparams *chainparams,
|
||||
const char *buffer,
|
||||
const jsmntok_t *tok, const u8 **scriptpubkey);
|
||||
|
||||
Reference in New Issue
Block a user