mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-05-30 17:50:58 +02:00
htlcswitch: add blinding point to decode hop iterator request
This commit is contained in:
parent
f090a64142
commit
7bf1daaade
@ -175,9 +175,10 @@ func (p *OnionProcessor) ReconstructHopIterator(r io.Reader, rHash []byte) (
|
|||||||
// packet, perform sphinx replay detection, and schedule the entry for garbage
|
// packet, perform sphinx replay detection, and schedule the entry for garbage
|
||||||
// collection.
|
// collection.
|
||||||
type DecodeHopIteratorRequest struct {
|
type DecodeHopIteratorRequest struct {
|
||||||
OnionReader io.Reader
|
OnionReader io.Reader
|
||||||
RHash []byte
|
RHash []byte
|
||||||
IncomingCltv uint32
|
IncomingCltv uint32
|
||||||
|
BlindingPoint *btcec.PublicKey
|
||||||
}
|
}
|
||||||
|
|
||||||
// DecodeHopIteratorResponse encapsulates the outcome of a batched sphinx onion
|
// DecodeHopIteratorResponse encapsulates the outcome of a batched sphinx onion
|
||||||
@ -233,8 +234,15 @@ func (p *OnionProcessor) DecodeHopIterators(id []byte,
|
|||||||
return lnwire.CodeInvalidOnionKey
|
return lnwire.CodeInvalidOnionKey
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var opts []sphinx.ProcessOnionOpt
|
||||||
|
if req.BlindingPoint != nil {
|
||||||
|
opts = append(opts, sphinx.WithBlindingPoint(
|
||||||
|
req.BlindingPoint,
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
err = tx.ProcessOnionPacket(
|
err = tx.ProcessOnionPacket(
|
||||||
seqNum, onionPkt, req.RHash, req.IncomingCltv,
|
seqNum, onionPkt, req.RHash, req.IncomingCltv, opts...,
|
||||||
)
|
)
|
||||||
switch err {
|
switch err {
|
||||||
case nil:
|
case nil:
|
||||||
|
@ -3160,9 +3160,10 @@ func (l *channelLink) processRemoteAdds(fwdPkg *channeldb.FwdPkg,
|
|||||||
onionReader := bytes.NewReader(pd.OnionBlob)
|
onionReader := bytes.NewReader(pd.OnionBlob)
|
||||||
|
|
||||||
req := hop.DecodeHopIteratorRequest{
|
req := hop.DecodeHopIteratorRequest{
|
||||||
OnionReader: onionReader,
|
OnionReader: onionReader,
|
||||||
RHash: pd.RHash[:],
|
RHash: pd.RHash[:],
|
||||||
IncomingCltv: pd.Timeout,
|
IncomingCltv: pd.Timeout,
|
||||||
|
BlindingPoint: pd.BlindingPoint,
|
||||||
}
|
}
|
||||||
|
|
||||||
decodeReqs = append(decodeReqs, req)
|
decodeReqs = append(decodeReqs, req)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user