Skip to content

Commit d30db59

Browse files
committed
Correct confusing docs on Channel methods
The methods return `Ok(())` always, they just happen to never return in the case of a duplicate claim if debug assertions are enabled.
1 parent 149464f commit d30db59

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lightning/src/ln/channel.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1946,7 +1946,7 @@ impl<Signer: Sign> Channel<Signer> {
19461946
/// before we fail backwards.
19471947
///
19481948
/// If we do fail twice, we debug_assert!(false) and return Ok(()). Thus, will always return
1949-
/// Ok(()) if debug assertions are turned on or preconditions are met.
1949+
/// Ok(()) if preconditions are met.
19501950
pub fn queue_fail_htlc<L: Deref>(&mut self, htlc_id_arg: u64, err_packet: msgs::OnionErrorPacket, logger: &L)
19511951
-> Result<(), ChannelError> where L::Target: Logger {
19521952
self.fail_htlc(htlc_id_arg, err_packet, true, logger)
@@ -1957,8 +1957,9 @@ impl<Signer: Sign> Channel<Signer> {
19571957
/// an HTLC more than once or fulfill once and then attempt to fail after reconnect. We cannot,
19581958
/// however, fail more than once as we wait for an upstream failure to be irrevocably committed
19591959
/// before we fail backwards.
1960+
///
19601961
/// If we do fail twice, we debug_assert!(false) and return Ok(None). Thus, will always return
1961-
/// Ok(_) if debug assertions are turned on or preconditions are met.
1962+
/// Ok(_) if preconditions are met.
19621963
fn fail_htlc<L: Deref>(&mut self, htlc_id_arg: u64, err_packet: msgs::OnionErrorPacket, mut force_holding_cell: bool, logger: &L)
19631964
-> Result<Option<msgs::UpdateFailHTLC>, ChannelError> where L::Target: Logger {
19641965
if (self.channel_state & (ChannelState::ChannelReady as u32)) != (ChannelState::ChannelReady as u32) {

0 commit comments

Comments
 (0)