Skip to content

Commit 22cb38b

Browse files
committed
Some changes in comments and error messages.
1 parent 78d0d16 commit 22cb38b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ln/channel.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,7 +1545,7 @@ impl Channel {
15451545
Ok(())
15461546
}
15471547

1548-
/// Removes an outbound HTLC which has been commitment_signed by the remote end
1548+
/// Marks an outbound HTLC which we have received update_fail/fulfill/malformed
15491549
#[inline]
15501550
fn mark_outbound_htlc_removed(&mut self, htlc_id: u64, check_preimage: Option<[u8; 32]>, fail_reason: Option<HTLCFailReason>) -> Result<&HTLCSource, ChannelError> {
15511551
for htlc in self.pending_outbound_htlcs.iter_mut() {
@@ -1559,13 +1559,13 @@ impl Channel {
15591559
};
15601560
match htlc.state {
15611561
OutboundHTLCState::LocalAnnounced(_) =>
1562-
return Err(ChannelError::Close("Remote tried to fulfill HTLC before it had been committed")),
1562+
return Err(ChannelError::Close("Remote tried to fulfill/fail HTLC before it had been committed")),
15631563
OutboundHTLCState::Committed => {
15641564
htlc.state = OutboundHTLCState::RemoteRemoved;
15651565
htlc.fail_reason = fail_reason;
15661566
},
15671567
OutboundHTLCState::AwaitingRemoteRevokeToRemove | OutboundHTLCState::AwaitingRemovedRemoteRevoke | OutboundHTLCState::RemoteRemoved =>
1568-
return Err(ChannelError::Close("Remote tried to fulfill HTLC that they'd already fulfilled")),
1568+
return Err(ChannelError::Close("Remote tried to fulfill/fail HTLC that they'd already fulfilled/failed")),
15691569
}
15701570
return Ok(&htlc.source);
15711571
}

0 commit comments

Comments
 (0)