Commit fd795d4
committed
onion: add payload type tracking to route_step and onion_payload
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-None1 parent 73147da commit fd795d4
File tree
5 files changed
+10
-6
lines changed- common
5 files changed
+10
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| 203 | + | |
203 | 204 | | |
204 | 205 | | |
205 | 206 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | 11 | | |
16 | 12 | | |
17 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
684 | 684 | | |
685 | 685 | | |
686 | 686 | | |
| 687 | + | |
687 | 688 | | |
688 | 689 | | |
689 | 690 | | |
| |||
718 | 719 | | |
719 | 720 | | |
720 | 721 | | |
| 722 | + | |
721 | 723 | | |
722 | 724 | | |
723 | 725 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
62 | 67 | | |
| 68 | + | |
63 | 69 | | |
64 | 70 | | |
65 | 71 | | |
| |||
0 commit comments