]> git.bitcoin.ninja Git - rust-lightning/commit
Replace maze of BOLT11 payment utilities with parameter generators
authorMatt Corallo <git@bluematt.me>
Fri, 10 Nov 2023 19:23:21 +0000 (19:23 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 10 Nov 2023 19:23:21 +0000 (19:23 +0000)
commita6039b9af2a82f4b28108fb1be0e5c1dd3035c0b
tree3b83b3280be76f451dd7c84576a305a1b7f8b607
parent6e40e5f18a8b6cde673e1ea80c2a2113d5c80483
Replace maze of BOLT11 payment utilities with parameter generators

`lightning-invoice` was historically responsible for actually
paying invoices, handling retries and everything. However, that
turned out to be buggy and hard to maintain, so the payment logic
was eventually moved into `ChannelManager`. However, the old
utilites remain.

Because our payment logic has a number of tunable parameters and
there are different ways to pay a BOLT11 invoice, we ended up with
six different methods to pay or probe a BOLT11 invoice, with more
requested as various options still were not exposed.

Instead, here, we replace all six methods with two simple ones
which return the arguments which need to be passed to
`ChannelManager`. Those arguments can be further tweaked before
passing them on, allowing more flexibility.
lightning-invoice/src/payment.rs