Skip to content

Commit ba8be5e

Browse files
committed
f Further document edge case where HTLC claiming can fail
1 parent 7ed7ee2 commit ba8be5e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1973,9 +1973,13 @@ impl<ChanSigner: ChannelKeys, M: Deref, T: Deref, K: Deref, F: Deref> ChannelMan
19731973
return Ok(())
19741974
},
19751975
Err(e) => {
1976-
// TODO: There is probably a channel manager somewhere that needs to
1977-
// learn the preimage as the channel may be about to hit the chain.
19781976
// TODO: Do something with e?
1977+
// This should only occur if we are claiming an HTLC at the same time as the
1978+
// HTLC is being failed (eg because a block is being connected and this caused
1979+
// an HTLC to time out). This should, of course, only occur if the user is the
1980+
// one doing the claiming (as it being a part of a peer claim would imply we're
1981+
// about to lose funds) and only if the lock in claim_funds was dropped as a
1982+
// previous HTLC was failed (thus not for an MPP payment).
19791983
debug_assert!(false, "This shouldn't be reachable except in absurdly rare cases between monitor updates and HTLC timeouts: {:?}", e);
19801984
return Err(None)
19811985
},

0 commit comments

Comments
 (0)