mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-20 04:21:37 +02:00
multi: explicitly signal final hop in pack hop payload
Previously, we'd use the value of nextChanID to infer whether a payload was for the final hop in a route. This commit updates our packing logic to explicitly signal to account for blinded routes, which allow zero value nextChanID in intermediate hops. This is a preparatory commit that allows us to more thoroughly validate payloads.
This commit is contained in:
@@ -121,7 +121,7 @@ func fuzzPayload(f *testing.F, finalPayload bool) {
|
||||
|
||||
var b bytes.Buffer
|
||||
hop, nextChanID := hopFromPayload(payload1)
|
||||
err = hop.PackHopPayload(&b, nextChanID)
|
||||
err = hop.PackHopPayload(&b, nextChanID, finalPayload)
|
||||
if errors.Is(err, route.ErrAMPMissingMPP) {
|
||||
// PackHopPayload refuses to encode an AMP record
|
||||
// without an MPP record. However, NewPayloadFromReader
|
||||
|
Reference in New Issue
Block a user