From dba08f9d1b07790c7f040aff6b785d696cefba3b Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 19 Feb 2018 11:36:15 +1030 Subject: [PATCH] peer_failed: don't send error ourselves. gossipd actually does that now, so we don't need this synchronous send hack. Signed-off-by: Rusty Russell --- common/peer_failed.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/common/peer_failed.c b/common/peer_failed.c index c01356687..113b0c07b 100644 --- a/common/peer_failed.c +++ b/common/peer_failed.c @@ -1,13 +1,10 @@ -#include #include -#include #include #include #include #include #include #include -#include /* We only support one channel per peer anyway */ void peer_failed_(int peer_fd, int gossip_fd, @@ -23,15 +20,10 @@ void peer_failed_(int peer_fd, int gossip_fd, desc = tal_vfmt(NULL, fmt, ap); va_end(ap); - status_broken("SENT ERROR:%s", desc); - msg = towire_errorfmt(desc, channel_id, "%s", desc); - - /* This is only best-effort; don't block. */ - io_fd_block(peer_fd, false); - sync_crypto_write(cs, peer_fd, msg); - msg = towire_status_peer_error(NULL, channel_id, - desc, cs, gossip_index, msg); + desc, cs, gossip_index, + towire_errorfmt(desc, channel_id, + "%s", desc)); tal_free(desc); status_send_fatal(take(msg), peer_fd, gossip_fd); }