devtools/bolt12-cli: add missing offer_metadata field.
What changed, and why it matters
This commit fixes a small display bug in a developer-only command-line tool (bolt12-cli). The tool decodes BOLT 12 offers, invoice requests, and invoices, but was failing to print the optional offer_metadata field. The fix simply adds three print statements so the field is shown when present. It does not change how Core Lightning nodes validate or process these messages, and there is no indication it fixes a security vulnerability.
No security action required; treat as a normal bugfix for a developer tool.
Security signals we found
No security-relevant code path modified
Developer tool output completeness fix only
No input parsing, memory allocation, or cryptographic logic changed
Evidence from the diff
In devtools/bolt12-cli.c, the BOLT12 pretty-printer omitted offer_metadata for decoded offers, invoice_requests, and invoices. The patch adds print_hex(“offer_metadata”, …) guarded by the corresponding field presence checks. This is a completeness fix in a developer utility; the underlying parsing/validation code already populates offer_metadata, and no logic affecting node behavior is changed.
Changed components
devtools/bolt12-cli.cInspect captured patch +6 / −0
diff --git a/devtools/bolt12-cli.c b/devtools/bolt12-cli.c
index 3a81467a..fc73c039 100644
--- a/devtools/bolt12-cli.c
+++ b/devtools/bolt12-cli.c
@@ -834,6 +834,8 @@ int main(int argc, char *argv[])
print_hash("offer_id", &offer_id);
if (offer->offer_chains)
print_offer_chains(offer->offer_chains);
+ if (offer->offer_metadata)
+ print_hex("offer_metadata", offer->offer_metadata);
if (offer->offer_amount)
well_formed &= print_offer_amount(offer->offer_chains,
offer->offer_currency,
@@ -903,6 +905,8 @@ int main(int argc, char *argv[])
print_hex("invreq_metadata", invreq->invreq_metadata);
if (invreq->offer_chains)
print_offer_chains(invreq->offer_chains);
+ if (invreq->offer_metadata)
+ print_hex("offer_metadata", invreq->offer_metadata);
if (invreq->offer_amount)
well_formed &= print_offer_amount(invreq->offer_chains,
invreq->offer_currency,
@@ -992,6 +996,8 @@ int main(int argc, char *argv[])
print_hex("invreq_metadata", invoice->invreq_metadata);
if (invoice->offer_chains)
print_offer_chains(invoice->offer_chains);
+ if (invoice->offer_metadata)
+ print_hex("offer_metadata", invoice->offer_metadata);
if (invoice->offer_amount)
well_formed &= print_offer_amount(invoice->offer_chains,
invoice->offer_currency,
Why this scored 16/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.