htlcswitch: add new incoming+outgoing timeout fields to htlcPacket
This commit is contained in:
parent
2bb5931bb7
commit
7b4c150983
@ -2373,14 +2373,16 @@ func (l *channelLink) processRemoteAdds(fwdPkg *channeldb.FwdPkg,
|
|||||||
chanIterator.EncodeNextHop(buf)
|
chanIterator.EncodeNextHop(buf)
|
||||||
|
|
||||||
updatePacket := &htlcPacket{
|
updatePacket := &htlcPacket{
|
||||||
incomingChanID: l.ShortChanID(),
|
incomingChanID: l.ShortChanID(),
|
||||||
incomingHTLCID: pd.HtlcIndex,
|
incomingHTLCID: pd.HtlcIndex,
|
||||||
outgoingChanID: fwdInfo.NextHop,
|
outgoingChanID: fwdInfo.NextHop,
|
||||||
sourceRef: pd.SourceRef,
|
sourceRef: pd.SourceRef,
|
||||||
incomingAmount: pd.Amount,
|
incomingAmount: pd.Amount,
|
||||||
amount: addMsg.Amount,
|
amount: addMsg.Amount,
|
||||||
htlc: addMsg,
|
htlc: addMsg,
|
||||||
obfuscator: obfuscator,
|
obfuscator: obfuscator,
|
||||||
|
incomingTimeout: pd.Timeout,
|
||||||
|
outgoingTimeout: fwdInfo.OutgoingCTLV,
|
||||||
}
|
}
|
||||||
switchPackets = append(
|
switchPackets = append(
|
||||||
switchPackets, updatePacket,
|
switchPackets, updatePacket,
|
||||||
@ -2439,14 +2441,16 @@ func (l *channelLink) processRemoteAdds(fwdPkg *channeldb.FwdPkg,
|
|||||||
// section.
|
// section.
|
||||||
if fwdPkg.State == channeldb.FwdStateLockedIn {
|
if fwdPkg.State == channeldb.FwdStateLockedIn {
|
||||||
updatePacket := &htlcPacket{
|
updatePacket := &htlcPacket{
|
||||||
incomingChanID: l.ShortChanID(),
|
incomingChanID: l.ShortChanID(),
|
||||||
incomingHTLCID: pd.HtlcIndex,
|
incomingHTLCID: pd.HtlcIndex,
|
||||||
outgoingChanID: fwdInfo.NextHop,
|
outgoingChanID: fwdInfo.NextHop,
|
||||||
sourceRef: pd.SourceRef,
|
sourceRef: pd.SourceRef,
|
||||||
incomingAmount: pd.Amount,
|
incomingAmount: pd.Amount,
|
||||||
amount: addMsg.Amount,
|
amount: addMsg.Amount,
|
||||||
htlc: addMsg,
|
htlc: addMsg,
|
||||||
obfuscator: obfuscator,
|
obfuscator: obfuscator,
|
||||||
|
incomingTimeout: pd.Timeout,
|
||||||
|
outgoingTimeout: fwdInfo.OutgoingCTLV,
|
||||||
}
|
}
|
||||||
|
|
||||||
fwdPkg.FwdFilter.Set(idx)
|
fwdPkg.FwdFilter.Set(idx)
|
||||||
|
@ -80,6 +80,15 @@ type htlcPacket struct {
|
|||||||
// circuit holds a reference to an Add's circuit which is persisted in
|
// circuit holds a reference to an Add's circuit which is persisted in
|
||||||
// the switch during successful forwarding.
|
// the switch during successful forwarding.
|
||||||
circuit *PaymentCircuit
|
circuit *PaymentCircuit
|
||||||
|
|
||||||
|
// incomingTimeout is the timeout that the incoming HTLC carried. This
|
||||||
|
// is the timeout of the HTLC applied to the incoming link.
|
||||||
|
incomingTimeout uint32
|
||||||
|
|
||||||
|
// outgoingTimeout is the timeout of the proposed outgoing HTLC. This
|
||||||
|
// will be extraced from the hop payload recevived by the incoming
|
||||||
|
// link.
|
||||||
|
outgoingTimeout uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
// inKey returns the circuit key used to identify the incoming htlc.
|
// inKey returns the circuit key used to identify the incoming htlc.
|
||||||
|
Loading…
Reference in New Issue
Block a user