common: expose is_signature_field as is_tlv_signature_field.
What changed, and why it matters
This commit simply renames an internal helper function and makes it publicly available in a header file so other parts of the codebase can use it. There is no bug fix, behavior change, or security-sensitive logic alteration. It is a routine code-organization change.
No security action required. Review as part of normal code maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change exposes the existing static function is_signature_field as a public function is_tlv_signature_field in common/bolt12_merkle.h, updating the one internal call site. The function’s logic—checking whether a TLV field’s type is in the BOLT #12 signature range 240–1000—remains identical. No security vulnerability is introduced or fixed by this commit.
Changed components
common/bolt12_merkle.ccommon/bolt12_merkle.hInspect captured patch +8 / −2
diff --git a/common/bolt12_merkle.c b/common/bolt12_merkle.c
index 0b2bd58..6fc2e5d 100644
--- a/common/bolt12_merkle.c
+++ b/common/bolt12_merkle.c
@@ -16,7 +16,7 @@
* Each form is signed using one or more *signature TLV elements*: TLV
* types 240 through 1000 (inclusive).
*/
-static bool is_signature_field(const struct tlv_field *field)
+bool is_tlv_signature_field(const struct tlv_field *field)
{
return field->numtype >= 240 && field->numtype <= 1000;
}
@@ -265,7 +265,7 @@ void merkle_tlv_full_(struct sha256 *merkle,
if (tal_count(leaves) == 0)
bolt12_lnnonce_ctx(&lnnonce_ctx, f);
- if (is_signature_field(f))
+ if (is_tlv_signature_field(f))
continue;
if (omitted) {
diff --git a/common/bolt12_merkle.h b/common/bolt12_merkle.h
index e014e5e..680152a 100644
--- a/common/bolt12_merkle.h
+++ b/common/bolt12_merkle.h
@@ -60,6 +60,12 @@ void bolt12_calc_nonce(const struct sha256_ctx *lnnonce_ctx,
struct sha256 *hash,
void *unused);
+/* BOLT #12:
+ * Each form is signed using one or more *signature TLV elements*: TLV
+ * types 240 through 1000 (inclusive).
+ */
+bool is_tlv_signature_field(const struct tlv_field *field);
+
/**
* sighash_from_merkle - bolt12-style signature hash using this merkle root.
* @messagename: message name, such as "offer".
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.