channeld: print out error msg if we receive one.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-12-19 10:32:28 +10:30
committed by Christian Decker
parent 477a529856
commit db1b9ffb61
2 changed files with 9 additions and 1 deletions

View File

@@ -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 \

View File

@@ -41,6 +41,7 @@
#include <common/timeout.h>
#include <common/type_to_string.h>
#include <common/version.h>
#include <common/wire_error.h>
#include <errno.h>
#include <fcntl.h>
#include <gossipd/gen_gossip_wire.h>
@@ -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: