common: remove unused type field.
What changed, and why it matters
This commit removes an unused 'type' field and its associated enum from a data structure used when building Lightning Network onion-routed payment packets. The commit message states the field was never actually set. This is a straightforward code cleanup with no apparent security relevance.
No security action needed; treat as routine refactoring/cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In common/onion_encode.h, the enum onion_payload_type and the enum onion_payload_type type member of struct onion_payload are removed. The codebase is described as always using modern TLV-style onion payloads, and the removed field was reportedly never populated. No functional logic changes are present in the diff.
Changed components
common/onion_encode.hInspect captured patch +0 / −6
diff --git a/common/onion_encode.h b/common/onion_encode.h
index a570b0d0..ac1acadc 100644
--- a/common/onion_encode.h
+++ b/common/onion_encode.h
@@ -7,13 +7,7 @@
struct route_step;
struct tlv_encrypted_data_tlv_payment_relay;
-enum onion_payload_type {
- ONION_V0_PAYLOAD = 0,
- ONION_TLV_PAYLOAD = 1,
-};
-
struct onion_payload {
- enum onion_payload_type type;
/* Is this the final hop? */
bool final;
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.