mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-11 01:54:25 +01:00
channel: Die on unexpected gossipd messages
This commit is contained in:
committed by
Rusty Russell
parent
3404509928
commit
605438f213
@@ -118,6 +118,9 @@ static struct io_plan *gossip_client_recv(struct io_conn *conn,
|
||||
if (type == WIRE_CHANNEL_ANNOUNCEMENT || type == WIRE_CHANNEL_UPDATE ||
|
||||
type == WIRE_NODE_ANNOUNCEMENT)
|
||||
msg_enqueue(&peer->peer_out, msg);
|
||||
else
|
||||
status_failed(WIRE_CHANNEL_GOSSIP_BAD_MESSAGE,
|
||||
"Got bad message from gossipd: %d", type);
|
||||
|
||||
return daemon_conn_read_next(conn, dc);
|
||||
}
|
||||
@@ -1327,6 +1330,7 @@ static struct io_plan *req_in(struct io_conn *conn, struct daemon_conn *master)
|
||||
case WIRE_CHANNEL_BAD_COMMAND:
|
||||
case WIRE_CHANNEL_HSM_FAILED:
|
||||
case WIRE_CHANNEL_CRYPTO_FAILED:
|
||||
case WIRE_CHANNEL_GOSSIP_BAD_MESSAGE:
|
||||
case WIRE_CHANNEL_INTERNAL_ERROR:
|
||||
case WIRE_CHANNEL_PEER_WRITE_FAILED:
|
||||
case WIRE_CHANNEL_PEER_READ_FAILED:
|
||||
|
||||
@@ -4,6 +4,7 @@ channel_bad_command,0x8000
|
||||
channel_hsm_failed,0x8001
|
||||
channel_crypto_failed,0x8002
|
||||
channel_internal_error,0x8003
|
||||
channel_gossip_bad_message,0x8004
|
||||
|
||||
# These are due to peer.
|
||||
channel_peer_write_failed,0x8010
|
||||
|
||||
|
@@ -1476,6 +1476,7 @@ static int channel_msg(struct subd *sd, const u8 *msg, const int *unused)
|
||||
case WIRE_CHANNEL_BAD_COMMAND:
|
||||
case WIRE_CHANNEL_HSM_FAILED:
|
||||
case WIRE_CHANNEL_CRYPTO_FAILED:
|
||||
case WIRE_CHANNEL_GOSSIP_BAD_MESSAGE:
|
||||
case WIRE_CHANNEL_INTERNAL_ERROR:
|
||||
case WIRE_CHANNEL_PEER_WRITE_FAILED:
|
||||
case WIRE_CHANNEL_PEER_READ_FAILED:
|
||||
|
||||
Reference in New Issue
Block a user