From fc92ae515b1414475e28cb9656ad45360b5817c1 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 11 Dec 2018 08:58:32 +1030 Subject: [PATCH] openingd: don't send opening_funder_failed twice funder gets a general error. Signed-off-by: Rusty Russell --- openingd/openingd.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/openingd/openingd.c b/openingd/openingd.c index 881a136c6..798954a5d 100644 --- a/openingd/openingd.c +++ b/openingd/openingd.c @@ -319,15 +319,17 @@ static u8 *opening_negotiate_msg(const tal_t *ctx, struct state *state, tal_free(msg); continue; } - if (am_funder) { - msg = towire_opening_funder_failed(NULL, err); - wire_sync_write(REQ_FD, take(msg)); - } /* Close connection on all_channels error. */ - if (all_channels) + if (all_channels) { + if (am_funder) { + msg = towire_opening_funder_failed(NULL, + err); + wire_sync_write(REQ_FD, take(msg)); + } peer_failed_received_errmsg(PEER_FD, GOSSIP_FD, &state->cs, err, NULL); + } negotiation_aborted(state, am_funder, tal_fmt(tmpctx, "They sent error %s", err));