htlcswitch: add blinding point to decode hop iterator request

This commit is contained in:
Carla Kirk-Cohen 2023-11-06 15:40:29 -05:00
parent f090a64142
commit 7bf1daaade
No known key found for this signature in database
GPG key ID: 4CA7FE54A6213C91
2 changed files with 16 additions and 7 deletions

View file

@ -175,9 +175,10 @@ 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
OnionReader io.Reader
RHash []byte
IncomingCltv uint32
BlindingPoint *btcec.PublicKey
}
// DecodeHopIteratorResponse encapsulates the outcome of a batched sphinx onion
@ -233,8 +234,15 @@ func (p *OnionProcessor) DecodeHopIterators(id []byte,
return lnwire.CodeInvalidOnionKey
}
var opts []sphinx.ProcessOnionOpt
if req.BlindingPoint != nil {
opts = append(opts, sphinx.WithBlindingPoint(
req.BlindingPoint,
))
}
err = tx.ProcessOnionPacket(
seqNum, onionPkt, req.RHash, req.IncomingCltv,
seqNum, onionPkt, req.RHash, req.IncomingCltv, opts...,
)
switch err {
case nil:

View file

@ -3160,9 +3160,10 @@ func (l *channelLink) processRemoteAdds(fwdPkg *channeldb.FwdPkg,
onionReader := bytes.NewReader(pd.OnionBlob)
req := hop.DecodeHopIteratorRequest{
OnionReader: onionReader,
RHash: pd.RHash[:],
IncomingCltv: pd.Timeout,
OnionReader: onionReader,
RHash: pd.RHash[:],
IncomingCltv: pd.Timeout,
BlindingPoint: pd.BlindingPoint,
}
decodeReqs = append(decodeReqs, req)