mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-18 19:41:21 +02:00
multi: return parsed types from payload
To separate blinded route parsing from payload parsing, we need to return the parsed types map so that we can properly validate blinded data payloads against what we saw in the onion.
This commit is contained in:
@@ -106,11 +106,13 @@ func (r *sphinxHopIterator) HopPayload() (*Payload, error) {
|
||||
// Otherwise, if this is the TLV payload, then we'll make a new stream
|
||||
// to decode only what we need to make routing decisions.
|
||||
case sphinx.PayloadTLV:
|
||||
return NewPayloadFromReader(
|
||||
payload, _, err := NewPayloadFromReader(
|
||||
bytes.NewReader(r.processedPacket.Payload.Payload),
|
||||
r.processedPacket.Action == sphinx.ExitNode,
|
||||
)
|
||||
|
||||
return payload, err
|
||||
|
||||
default:
|
||||
return nil, fmt.Errorf("unknown sphinx payload type: %v",
|
||||
r.processedPacket.Payload.Type)
|
||||
|
Reference in New Issue
Block a user