diff --git a/lightningd/log.c b/lightningd/log.c index 09a510e19..8828f6996 100644 --- a/lightningd/log.c +++ b/lightningd/log.c @@ -207,7 +207,7 @@ static void log_to_files(const char *log_prefix, struct log_file **log_files) { char tstamp[sizeof("YYYY-mm-ddTHH:MM:SS.nnnZ ")]; - char *entry, *nodestr; + char *entry, nodestr[hex_str_size(PUBKEY_CMPR_LEN)]; bool filtered; if (print_timestamps) { @@ -218,9 +218,10 @@ static void log_to_files(const char *log_prefix, tstamp[0] = '\0'; if (node_id) - nodestr = fmt_node_id(tmpctx, node_id); + hex_encode(node_id->k, sizeof(node_id->k), + nodestr, sizeof(nodestr)); else - nodestr = ""; + nodestr[0] = '\0'; if (level == LOG_IO_IN || level == LOG_IO_OUT) { const char *dir = level == LOG_IO_IN ? "[IN]" : "[OUT]"; char *hex = tal_hexstr(NULL, io, io_len);