openingd: don't create trivial single-use is_all_channel_error function.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2018-12-11 09:01:32 +10:30 committed by neil saitug
parent 1259e10761
commit 338e4bab45

View File

@ -1054,21 +1054,15 @@ static void handle_gossip_in(struct state *state)
handle_gossip_msg(PEER_FD, &state->cs, take(msg));
}
static bool is_all_channel_error(const u8 *msg)
static void fail_if_all_error(const u8 *inner)
{
struct channel_id channel_id;
u8 *data;
if (!fromwire_error(msg, msg, &channel_id, &data))
return false;
tal_free(data);
return channel_id_is_all(&channel_id);
}
static void fail_if_all_error(const u8 *inner)
{
if (!is_all_channel_error(inner))
if (!fromwire_error(tmpctx, inner, &channel_id, &data)
|| !channel_id_is_all(&channel_id)) {
return;
}
status_info("Master said send err: %s",
sanitize_error(tmpctx, inner, NULL));