mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-21 06:06:20 +02:00
htlcswitch: expose custom records on intercepted packet
This commit is contained in:
@@ -127,6 +127,7 @@ func (f *interceptedForward) Packet() InterceptedPacket {
|
||||
OutgoingAmount: f.htlc.Amount,
|
||||
IncomingAmount: f.packet.incomingAmount,
|
||||
IncomingExpiry: f.packet.incomingTimeout,
|
||||
CustomRecords: f.packet.customRecords,
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -8,6 +8,7 @@ import (
|
||||
"github.com/lightningnetwork/lnd/lntypes"
|
||||
"github.com/lightningnetwork/lnd/lnwallet"
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
"github.com/lightningnetwork/lnd/record"
|
||||
)
|
||||
|
||||
// InvoiceDatabase is an interface which represents the persistent subsystem
|
||||
@@ -226,6 +227,10 @@ type InterceptedPacket struct {
|
||||
|
||||
// IncomingAmount is the amount of the accepted htlc.
|
||||
IncomingAmount lnwire.MilliSatoshi
|
||||
|
||||
// CustomRecords are user-defined records in the custom type range that
|
||||
// were included in the payload.
|
||||
CustomRecords record.CustomSet
|
||||
}
|
||||
|
||||
// InterceptedForward is passed to the ForwardInterceptor for every forwarded
|
||||
|
@@ -2731,6 +2731,7 @@ func (l *channelLink) processRemoteAdds(fwdPkg *channeldb.FwdPkg,
|
||||
obfuscator: obfuscator,
|
||||
incomingTimeout: pd.Timeout,
|
||||
outgoingTimeout: fwdInfo.OutgoingCTLV,
|
||||
customRecords: pld.CustomRecords(),
|
||||
}
|
||||
switchPackets = append(
|
||||
switchPackets, updatePacket,
|
||||
@@ -2794,6 +2795,7 @@ func (l *channelLink) processRemoteAdds(fwdPkg *channeldb.FwdPkg,
|
||||
obfuscator: obfuscator,
|
||||
incomingTimeout: pd.Timeout,
|
||||
outgoingTimeout: fwdInfo.OutgoingCTLV,
|
||||
customRecords: pld.CustomRecords(),
|
||||
}
|
||||
|
||||
fwdPkg.FwdFilter.Set(idx)
|
||||
|
@@ -4,6 +4,7 @@ import (
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/htlcswitch/hop"
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
"github.com/lightningnetwork/lnd/record"
|
||||
)
|
||||
|
||||
// htlcPacket is a wrapper around htlc lnwire update, which adds additional
|
||||
@@ -91,6 +92,10 @@ type htlcPacket struct {
|
||||
// will be extraced from the hop payload recevived by the incoming
|
||||
// link.
|
||||
outgoingTimeout uint32
|
||||
|
||||
// customRecords are user-defined records in the custom type range that
|
||||
// were included in the payload.
|
||||
customRecords record.CustomSet
|
||||
}
|
||||
|
||||
// inKey returns the circuit key used to identify the incoming htlc.
|
||||
|
Reference in New Issue
Block a user