Some changes in comments and error messages.
authorYuntai Kyong <yuntai.kyong@gmail.com>
Sun, 14 Oct 2018 13:34:45 +0000 (22:34 +0900)
committerYuntai Kyong <yuntai.kyong@gmail.com>
Sun, 14 Oct 2018 14:01:18 +0000 (23:01 +0900)
src/ln/channel.rs

index 894ecdc19b091260f633cf89b9c36b3aa4fd2973..ea087390cc3aa882c7de5e75faab0e6691d7b9aa 100644 (file)
@@ -1541,7 +1541,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<HTLCFailReason>) -> Result<&HTLCSource, ChannelError> {
                for htlc in self.pending_outbound_htlcs.iter_mut() {
@@ -1555,13 +1555,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);
                        }