htlcswitch: expose additional fields for intercepted packets

This commit is contained in:
Joost Jager
2020-06-23 16:22:00 +02:00
parent 74db43282c
commit 363142de33
7 changed files with 253 additions and 161 deletions

View File

@@ -121,9 +121,12 @@ func (f *interceptedForward) Packet() InterceptedPacket {
ChanID: f.packet.incomingChanID,
HtlcID: f.packet.incomingHTLCID,
},
OutgoingChanID: f.packet.outgoingChanID,
Hash: f.htlc.PaymentHash,
OutgoingExpiry: f.htlc.Expiry,
OutgoingAmount: f.htlc.Amount,
IncomingAmount: f.packet.incomingAmount,
IncomingExpiry: f.packet.incomingTimeout,
}
}

View File

@@ -207,6 +207,9 @@ type InterceptedPacket struct {
// packet.
IncomingCircuit channeldb.CircuitKey
// OutgoingChanID is the destination channel for this packet.
OutgoingChanID lnwire.ShortChannelID
// Hash is the payment hash of the htlc.
Hash lntypes.Hash
@@ -216,6 +219,13 @@ type InterceptedPacket struct {
// OutgoingAmount is the amount to forward.
OutgoingAmount lnwire.MilliSatoshi
// IncomingExpiry is the absolute block height at which the incoming
// htlc expires.
IncomingExpiry uint32
// IncomingAmount is the amount of the accepted htlc.
IncomingAmount lnwire.MilliSatoshi
}
// InterceptedForward is passed to the ForwardInterceptor for every forwarded