Allow users to specify the `PaymentId` used in `InvoicePayer`
authorMatt Corallo <git@bluematt.me>
Wed, 2 Nov 2022 01:06:39 +0000 (01:06 +0000)
committerMatt Corallo <git@bluematt.me>
Wed, 2 Nov 2022 01:09:07 +0000 (01:09 +0000)
commitb5f1da60348028c60788f59e451737411e279206
tree1a5319061273c06bf7235e0b65dcca0a8a0ee2ac
parent0ae45a2578b41fde39ba9bb5e6e33af62b319f04
Allow users to specify the `PaymentId` used in `InvoicePayer`

In order to allow users to pass a custom idempotency key to the
`send*` methods in `InvoicePayer`, we have to pipe the `PaymentId`
through to the `Payer` methods, which we do here.

By default, existing `InvoicePayer` methods use the `PaymentHash`
as the `PaymentId`, however we also add duplicate `send*_with_id`
methods which allow users to pass a custom `PaymentId`.

Finally, appropriate documentation updates are made to clarify
idempotency guarantees.
lightning-invoice/src/payment.rs
lightning-invoice/src/utils.rs