mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-26 08:55:59 +01:00
htlcswitch: add blinding point to decode hop iterator request
This commit is contained in:
parent
f090a64142
commit
7bf1daaade
2 changed files with 16 additions and 7 deletions
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue