Skip to content

Commit

Permalink
f tweak send_htlc docs to describe new failure conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBlueMatt committed Jun 25, 2021
1 parent c0e4cf3 commit 8671aca
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lightning/src/ln/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3974,9 +3974,13 @@ impl<Signer: Sign> Channel<Signer> {

/// Adds a pending outbound HTLC to this channel, note that you probably want
/// send_htlc_and_commit instead cause you'll want both messages at once.
/// This returns an option instead of a pure UpdateAddHTLC as we may be in a state where we are
/// waiting on the remote peer to send us a revoke_and_ack during which time we cannot add new
/// HTLCs on the wire or we wouldn't be able to determine what they actually ACK'ed.
/// This returns an option instead of a pure UpdateAddHTLC as we may be in a state where we
/// cannot add HTLCs on the wire.
/// In cases where we're waiting on the remote peer to send us a revoke_and_ack, if we did, we
/// wouldn't be able to determine what they actually ACK'ed when we do receive the
/// revoke_and_ack.
/// In cases where we're marked MonitorUpdateFailed, we cannot commit to a new state as we may
/// not yet have sent the previous commitment update messages and will need to regenerate them.
/// You MUST call send_commitment prior to any other calls on this Channel
/// If an Err is returned, it's a ChannelError::Ignore!
pub fn send_htlc(&mut self, amount_msat: u64, payment_hash: PaymentHash, cltv_expiry: u32, source: HTLCSource, onion_routing_packet: msgs::OnionPacket) -> Result<Option<msgs::UpdateAddHTLC>, ChannelError> {
Expand Down

0 comments on commit 8671aca

Please sign in to comment.