Currently, according to documentation for HTLCIntercepted, ChannelManager::forward_intercepted_htlc or ChannelManager::fail_intercepted_htlc must be called in response to all intercepted HTLCs. Essentially we can either re-route the payment to a real channel, or unwind it. But what if we want to get the pre-image out-of-band? I'd like to be able to respond to an HTLCIntercepted event by fetching the pre-image outside of the lightning protocol and simply providing it to the ChannelManager to claim the funds. claim_funds() is just the method I'm looking for! If calling claim_funds() on intercepted HTLCs would already work, let's update the documentation to reflect this. If not, let's add support for it. Either way, we should update do_test_intercepted_payment().
For context, I'm working on building a Fedimint lightning gateway, where pre-images are received through what is essentially a federation-enforced HTLC, and the final hop happens separate from lightning.
Currently, according to documentation for
HTLCIntercepted,ChannelManager::forward_intercepted_htlcorChannelManager::fail_intercepted_htlcmust be called in response to all intercepted HTLCs. Essentially we can either re-route the payment to a real channel, or unwind it. But what if we want to get the pre-image out-of-band? I'd like to be able to respond to anHTLCInterceptedevent by fetching the pre-image outside of the lightning protocol and simply providing it to theChannelManagerto claim the funds.claim_funds()is just the method I'm looking for! If callingclaim_funds()on intercepted HTLCs would already work, let's update the documentation to reflect this. If not, let's add support for it. Either way, we should updatedo_test_intercepted_payment().For context, I'm working on building a Fedimint lightning gateway, where pre-images are received through what is essentially a federation-enforced HTLC, and the final hop happens separate from lightning.