forked from ElementsProject/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information
1 parent
2f667c5
commit c8c3294
Showing
9 changed files
with
886 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.