Skip to content

Commit 74a1070

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 916f666 commit 74a1070

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
@@ -1948,7 +1948,7 @@ impl<Signer: Sign> Channel<Signer> {
19481948
/// before we fail backwards.
19491949
///
19501950
/// If we do fail twice, we debug_assert!(false) and return Ok(()). Thus, will always return
1951-
/// Ok(()) if debug assertions are turned on or preconditions are met.
1951+
/// Ok(()) if preconditions are met.
19521952
pub fn queue_fail_htlc<L: Deref>(&mut self, htlc_id_arg: u64, err_packet: msgs::OnionErrorPacket, logger: &L)
19531953
-> Result<(), ChannelError> where L::Target: Logger {
19541954
self.fail_htlc(htlc_id_arg, err_packet, true, logger)
@@ -1959,8 +1959,9 @@ impl<Signer: Sign> Channel<Signer> {
19591959
/// an HTLC more than once or fulfill once and then attempt to fail after reconnect. We cannot,
19601960
/// however, fail more than once as we wait for an upstream failure to be irrevocably committed
19611961
/// before we fail backwards.
1962+
///
19621963
/// If we do fail twice, we debug_assert!(false) and return Ok(None). Thus, will always return
1963-
/// Ok(_) if debug assertions are turned on or preconditions are met.
1964+
/// Ok(_) if preconditions are met.
19641965
fn fail_htlc<L: Deref>(&mut self, htlc_id_arg: u64, err_packet: msgs::OnionErrorPacket, mut force_holding_cell: bool, logger: &L)
19651966
-> Result<Option<msgs::UpdateFailHTLC>, ChannelError> where L::Target: Logger {
19661967
if (self.channel_state & (ChannelState::ChannelReady as u32)) != (ChannelState::ChannelReady as u32) {

0 commit comments

Comments
 (0)