libplugin: expose json_add_keypath.
What changed, and why it matters
This commit simply makes an existing internal helper function available for use by other parts of the codebase. It does not change any behavior, fix any bug, or introduce any new functionality that could be misused. There is no security relevance visible in the change itself.
No security action required. Review as normal code refactoring.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch changes json_add_keypath from a static internal function in plugins/libplugin.c to a public function exported via plugins/libplugin.h. The function body is unchanged. It is a straightforward API exposure/refactoring change with no security implications evident from the diff.
Changed components
plugins/libplugin.cplugins/libplugin.hInspect captured patch +8 / −3
diff --git a/plugins/libplugin.c b/plugins/libplugin.c
index 861e7b4a..2bc153f6 100644
--- a/plugins/libplugin.c
+++ b/plugins/libplugin.c
@@ -848,9 +848,9 @@ void rpc_scan(struct command *cmd,
guide, method, err);
}
-static void json_add_keypath(struct json_out *jout,
- const char *fieldname,
- const char **keys)
+void json_add_keypath(struct json_out *jout,
+ const char *fieldname,
+ const char **keys)
{
json_out_start(jout, fieldname, '[');
for (size_t i = 0; i < tal_count(keys); i++)
diff --git a/plugins/libplugin.h b/plugins/libplugin.h
index 3e435f65..9134d2a2 100644
--- a/plugins/libplugin.h
+++ b/plugins/libplugin.h
@@ -700,6 +700,11 @@ struct listpeers_channel **json_to_listpeers_channels(const tal_t *ctx,
const char *buffer,
const jsmntok_t *tok);
+/* Helper to write keys[] array (mainly for datastore ops) */
+void json_add_keypath(struct json_out *jout,
+ const char *fieldname,
+ const char **keys);
+
struct createonion_response {
u8 *onion;
struct secret *shared_secrets;
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.