htlcswitch: when forwarding htlcs, set the incomingHtlcAmt

This commit is contained in:
Olaoluwa Osuntokun 2018-02-27 22:14:44 -08:00
parent d377ffafdd
commit 6f11fee1a4
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21
1 changed files with 13 additions and 12 deletions

View File

@ -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)
}