From 6f11fee1a41460c8f62024e6290972572f063446 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 27 Feb 2018 22:14:44 -0800 Subject: [PATCH] htlcswitch: when forwarding htlcs, set the incomingHtlcAmt --- htlcswitch/link.go | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/htlcswitch/link.go b/htlcswitch/link.go index c0994d3f..c0c3e8f3 100644 --- a/htlcswitch/link.go +++ b/htlcswitch/link.go @@ -1395,8 +1395,8 @@ func (l *channelLink) processLockedInHtlcs( switch pd.EntryType { // A settle for an HTLC we previously forwarded HTLC has been - // received. So we'll forward the HTLC to the switch which - // will handle propagating the settle to the prior hop. + // received. So we'll forward the HTLC to the switch which will + // handle propagating the settle to the prior hop. case lnwallet.Settle: settlePacket := &htlcPacket{ outgoingChanID: l.ShortChanID(), @@ -1413,10 +1413,10 @@ func (l *channelLink) processLockedInHtlcs( packetsToForward = append(packetsToForward, settlePacket) l.overflowQueue.SignalFreeSlot() - // A failureCode message for a previously forwarded HTLC has been - // received. As a result a new slot will be freed up in our - // commitment state, so we'll forward this to the switch so the - // backwards undo can continue. + // A failureCode message for a previously forwarded HTLC has + // been received. As a result a new slot will be freed up in + // our commitment state, so we'll forward this to the switch so + // the backwards undo can continue. case lnwallet.Fail: // Fetch the reason the HTLC was cancelled so we can // continue to propagate it. @@ -1820,12 +1820,13 @@ func (l *channelLink) processLockedInHtlcs( } updatePacket := &htlcPacket{ - incomingChanID: l.ShortChanID(), - incomingHTLCID: pd.HtlcIndex, - outgoingChanID: fwdInfo.NextHop, - amount: addMsg.Amount, - htlc: addMsg, - obfuscator: obfuscator, + incomingChanID: l.ShortChanID(), + incomingHTLCID: pd.HtlcIndex, + outgoingChanID: fwdInfo.NextHop, + incomingHtlcAmt: pd.Amount, + amount: addMsg.Amount, + htlc: addMsg, + obfuscator: obfuscator, } packetsToForward = append(packetsToForward, updatePacket) }