Skip to content

Conversation

@erickcestari
Copy link
Contributor

Move onion_payload_type enum to sphinx.h and add type field to both route_step and onion_payload structures. This allows code to easily determine whether it's dealing with legacy v0 or modern TLV payloads without re-parsing the raw payload.

The type is set during onion processing in process_onionpacket() based on the payload format detected, then propagated to onion_payload in onion_decode().

Changelog-None

Add `onion_payload_type` enum and `type` field to track whether payloads
are legacy v0 or modern TLV format.

Move the `onion_payload_type` enum from `onion_encode.h` to `sphinx.h`
and add a `type` field to both `route_step` and `onion_payload` structures.
Previously, `onion_payload` had the `type` field declared but it was never
set or used.

The type is now set during onion processing in `process_onionpacket()` based
on the payload format detected, then propagated to `onion_payload` in
`onion_decode()`. This allows code to easily determine the payload format
without re-parsing the raw payload.

Changelog-None
@erickcestari erickcestari force-pushed the track-onion-payload-type branch from fd795d4 to ea7a032 Compare November 17, 2025 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant