From d3ca7da67268568227472bc689268d73b5853e44 Mon Sep 17 00:00:00 2001 From: Yuntai Kyong Date: Sun, 14 Oct 2018 22:34:45 +0900 Subject: [PATCH] Some changes in comments and error messages. --- src/ln/channel.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ln/channel.rs b/src/ln/channel.rs index 82c26a0aa..464bfc6e3 100644 --- a/src/ln/channel.rs +++ b/src/ln/channel.rs @@ -1545,7 +1545,7 @@ impl Channel { Ok(()) } - /// Removes an outbound HTLC which has been commitment_signed by the remote end + /// Marks an outbound HTLC which we have received update_fail/fulfill/malformed #[inline] fn mark_outbound_htlc_removed(&mut self, htlc_id: u64, check_preimage: Option<[u8; 32]>, fail_reason: Option) -> Result<&HTLCSource, ChannelError> { for htlc in self.pending_outbound_htlcs.iter_mut() { @@ -1559,13 +1559,13 @@ impl Channel { }; match htlc.state { OutboundHTLCState::LocalAnnounced(_) => - return Err(ChannelError::Close("Remote tried to fulfill HTLC before it had been committed")), + return Err(ChannelError::Close("Remote tried to fulfill/fail HTLC before it had been committed")), OutboundHTLCState::Committed => { htlc.state = OutboundHTLCState::RemoteRemoved; htlc.fail_reason = fail_reason; }, OutboundHTLCState::AwaitingRemoteRevokeToRemove | OutboundHTLCState::AwaitingRemovedRemoteRevoke | OutboundHTLCState::RemoteRemoved => - return Err(ChannelError::Close("Remote tried to fulfill HTLC that they'd already fulfilled")), + return Err(ChannelError::Close("Remote tried to fulfill/fail HTLC that they'd already fulfilled/failed")), } return Ok(&htlc.source); } -- 2.39.5