mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-31 17:51:33 +02:00
htlcswitch: add incoming amount and to decode hop iterator request
When we have payments inside of a blinded route, we need to know the incoming amount to be able to back-calculate the amount that we need to forward using the forwarding parameters provided in the blinded route encrypted data. This commit adds the payment amount to our DecodeHopIteratorRequest so that it can be threaded down to payment forwarding information creation in later commits.
This commit is contained in:
@@ -175,10 +175,11 @@ func (p *OnionProcessor) ReconstructHopIterator(r io.Reader, rHash []byte) (
|
||||
// packet, perform sphinx replay detection, and schedule the entry for garbage
|
||||
// collection.
|
||||
type DecodeHopIteratorRequest struct {
|
||||
OnionReader io.Reader
|
||||
RHash []byte
|
||||
IncomingCltv uint32
|
||||
BlindingPoint *btcec.PublicKey
|
||||
OnionReader io.Reader
|
||||
RHash []byte
|
||||
IncomingCltv uint32
|
||||
IncomingAmount lnwire.MilliSatoshi
|
||||
BlindingPoint *btcec.PublicKey
|
||||
}
|
||||
|
||||
// DecodeHopIteratorResponse encapsulates the outcome of a batched sphinx onion
|
||||
|
@@ -3160,10 +3160,11 @@ func (l *channelLink) processRemoteAdds(fwdPkg *channeldb.FwdPkg,
|
||||
onionReader := bytes.NewReader(pd.OnionBlob)
|
||||
|
||||
req := hop.DecodeHopIteratorRequest{
|
||||
OnionReader: onionReader,
|
||||
RHash: pd.RHash[:],
|
||||
IncomingCltv: pd.Timeout,
|
||||
BlindingPoint: pd.BlindingPoint,
|
||||
OnionReader: onionReader,
|
||||
RHash: pd.RHash[:],
|
||||
IncomingCltv: pd.Timeout,
|
||||
IncomingAmount: pd.Amount,
|
||||
BlindingPoint: pd.BlindingPoint,
|
||||
}
|
||||
|
||||
decodeReqs = append(decodeReqs, req)
|
||||
|
Reference in New Issue
Block a user