]> git.bitcoin.ninja Git - rust-lightning/commit
Filter route hints for phantom invoices
authorViktor Tigerström <11711198+ViktorTigerstrom@users.noreply.github.com>
Mon, 21 Feb 2022 20:18:45 +0000 (21:18 +0100)
committerViktor Tigerström <11711198+ViktorTigerstrom@users.noreply.github.com>
Wed, 16 Mar 2022 10:24:12 +0000 (11:24 +0100)
commit43cc81c893fdd8b3e9d8b150fedc0839e29e40a9
tree42b04c55fa227e5a9eb4aa97a14cfc0c66ddb4fa
parenteae5086b8db798d477773a1341f2ff75b65b8837
Filter route hints for phantom invoices

Filter the route hints in `create_phantom_invoice` based on the
following criteria:

* Only one channel for every counterparty node per phantom
payment-receiving node in the invoice
* Always select the channel with the highest inbound capacity
* For each payment-receiving node, filter out channels with a lower
inbound capacity than the invoice amount, if any channel exists with
enough capacity to cover the invoice amount
* If any public channels exists for a payment-receiving node, push a
single RouteHintHop with the phantom route and let the sender find the
path to the payment-receiving node through the public channels.
lightning-invoice/src/utils.rs