From 338e4bab45a86838e8014d1a561a487a2c40640b Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 11 Dec 2018 09:01:32 +1030 Subject: [PATCH] openingd: don't create trivial single-use is_all_channel_error function. Signed-off-by: Rusty Russell --- openingd/openingd.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/openingd/openingd.c b/openingd/openingd.c index a01466abd..1f069a18c 100644 --- a/openingd/openingd.c +++ b/openingd/openingd.c @@ -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));