Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions channeld/full_channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1658,13 +1658,13 @@ bool channel_force_htlcs(struct channel *channel,

const char *channel_add_err_name(enum channel_add_err e)
{
static char invalidbuf[sizeof("INVALID ") + STR_MAX_CHARS(e)];
static char invalidbuf[sizeof("UNKNOWN ") + STR_MAX_CHARS(e)];

for (size_t i = 0; enum_channel_add_err_names[i].name; i++) {
if (enum_channel_add_err_names[i].v == e)
return enum_channel_add_err_names[i].name;
}
snprintf(invalidbuf, sizeof(invalidbuf), "INVALID %i", e);
snprintf(invalidbuf, sizeof(invalidbuf), "UNKNOWN %i", e);
return invalidbuf;
}

Expand Down
2 changes: 1 addition & 1 deletion lightningd/pay.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ json_add_routefail_info(struct json_stream *js,
json_add_num(js, "erring_index", erring_index);
json_add_num(js, "failcode", failcode);
/* FIXME: Better way to detect this? */
if (!strstarts(failcodename, "INVALID "))
if (!strstarts(failcodename, "UNKNOWN "))
json_add_string(js, "failcodename", failcodename);

if (erring_node != NULL)
Expand Down
2 changes: 1 addition & 1 deletion lightningd/subd.c
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ void subd_send_msg(struct subd *sd, const u8 *msg_out)
u16 type = fromwire_peektype(msg_out);
/* FIXME: We should use unique upper bits for each daemon, then
* have generate-wire.py add them, just assert here. */
if (strstarts(sd->msgname(type), "INVALID"))
if (strstarts(sd->msgname(type), "UNKNOWN"))
fatal("Sending %s an invalid message %s", sd->name, tal_hex(tmpctx, msg_out));
msg_enqueue(sd->outq, msg_out);
}
Expand Down
4 changes: 2 additions & 2 deletions tools/gen/impl_template
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ ${i}

const char *${enum_set['name']}_name(int e)
{
static char invalidbuf[sizeof("INVALID ") + STR_MAX_CHARS(e)];
static char invalidbuf[sizeof("UNKNOWN ") + STR_MAX_CHARS(e)];

switch ((enum ${enum_set['name']})e) {
% for msg in enum_set['set']:
case ${msg.enum_name()}: return "${msg.enum_name()}";
% endfor
}

snprintf(invalidbuf, sizeof(invalidbuf), "INVALID %i", e);
snprintf(invalidbuf, sizeof(invalidbuf), "UNKNOWN %i", e);
return invalidbuf;
}

Expand Down
Loading