From db1b9ffb61ab406d2e9fc382feb283c1e79b7f95 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 19 Dec 2017 10:32:28 +1030 Subject: [PATCH] channeld: print out error msg if we receive one. Signed-off-by: Rusty Russell --- channeld/Makefile | 1 + channeld/channel.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/channeld/Makefile b/channeld/Makefile index 26c3124f6..169bf7a45 100644 --- a/channeld/Makefile +++ b/channeld/Makefile @@ -61,6 +61,7 @@ CHANNELD_COMMON_OBJS := \ common/utils.o \ common/utxo.o \ common/version.o \ + common/wire_error.o \ common/wireaddr.o \ gossipd/gen_gossip_wire.o \ lightningd/gossip_msg.o \ diff --git a/channeld/channel.c b/channeld/channel.c index cf0e8324b..c763605a9 100644 --- a/channeld/channel.c +++ b/channeld/channel.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -1469,8 +1470,14 @@ static void peer_in(struct peer *peer, const u8 *msg) handle_peer_shutdown(peer, msg); return; - case WIRE_INIT: case WIRE_ERROR: + peer_failed(PEER_FD, + &peer->cs, + &peer->channel_id, + "Peer sent error %s", + sanitize_error(peer, msg, NULL)); + + case WIRE_INIT: case WIRE_OPEN_CHANNEL: case WIRE_ACCEPT_CHANNEL: case WIRE_FUNDING_CREATED: