fix: Remove "Printing" from listdatastore debug log.
What changed, and why it matters
This commit simply removes several noisy debug log messages from the listdatastore command. It does not change program behavior, fix a bug, or affect security. The removed messages were developer-only diagnostics that could leak datastore key names into logs, but they were already at the debug log level and not a security vulnerability.
No security action needed. Treat as routine code hygiene.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch deletes eight lines of log_debug() calls in lightningd/datastore.c’s json_listdatastore(). These logs recorded the search key, each matched key, whether a key was too long to print, and when a key was being printed. No functional logic is altered; the JSON output and wallet queries remain identical. The commit message frames this as a cleanup (‘Remove ‘Printing’ from listdatastore debug log’) with no changelog.
Changed components
lightningd/datastore.cInspect captured patch +0 / −8
diff --git a/lightningd/datastore.c b/lightningd/datastore.c
index 0f589a7c..f3ecfc6d 100644
--- a/lightningd/datastore.c
+++ b/lightningd/datastore.c
@@ -222,10 +222,6 @@ static struct command_result *json_listdatastore(struct command *cmd,
NULL))
return command_param_failed();
- if (key)
- log_debug(cmd->ld->log, "Looking for %s",
- datastore_key_fmt(tmpctx, key));
-
response = json_stream_success(cmd);
json_array_start(response, "datastore");
@@ -235,12 +231,9 @@ static struct command_result *json_listdatastore(struct command *cmd,
stmt = wallet_datastore_next(cmd, key,
stmt, &k, &data,
&generation)) {
- log_debug(cmd->ld->log, "Got %s",
- datastore_key_fmt(tmpctx, k));
/* Don't list sub-children, except as summary to show it exists. */
if (tal_count(k) > tal_count(key) + 1) {
- log_debug(cmd->ld->log, "Too long");
if (!prev_k || !datastore_key_startswith(k, prev_k)) {
prev_k = tal_dup_arr(cmd, const char *, k,
tal_count(key) + 1, 0);
@@ -249,7 +242,6 @@ static struct command_result *json_listdatastore(struct command *cmd,
json_object_end(response);
}
} else {
- log_debug(cmd->ld->log, "Printing");
json_object_start(response, NULL);
json_add_datastore(response, k, data, generation);
json_object_end(response);
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.