Add FailureCode enum and ChannelManager::fail_htlc_backwards_with_reason
authorAlec Chen <alecchendev@gmail.com>
Wed, 25 Jan 2023 18:27:59 +0000 (12:27 -0600)
committerAlec Chen <alecchendev@gmail.com>
Wed, 25 Jan 2023 21:35:59 +0000 (15:35 -0600)
commit95892e37daeda1fd8e89b3e97e6e4e5cdba99d52
tree3b87645cfd71ba51b5b5ecaa877d7565a4c2e17f
parente0a0add9fe0b239f8a5176ab62e7ba3cb4f541ca
Add FailureCode enum and ChannelManager::fail_htlc_backwards_with_reason

FailureCode is used to specify which error code and data to send
to peers when failing back an HTLC.

ChannelManager::fail_htlc_backwards_with_reason
allows a user to specify the error code and
corresponding data to send to peers when failing back an HTLC.
This function is mentioned in Event::PaymentClaimable docs.
ChannelManager::get_htlc_fail_reason_from_failure_code was also
added to assist with this function.
lightning/src/ln/channelmanager.rs
lightning/src/util/events.rs