Skip to content

Commit 71f13ab

Browse files
rustyrussellcdecker
authored andcommitted
channeld: ignore spurious open_channel packets.
Currently we peer_failed() which fails the existing channel too! Fixes: #494 Signed-off-by: Rusty Russell <[email protected]>
1 parent 2bc2502 commit 71f13ab

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

channeld/channel.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,6 +1534,21 @@ static void peer_in(struct peer *peer, const u8 *msg)
15341534
enum wire_type type = fromwire_peektype(msg);
15351535
status_trace("peer_in %s", wire_type_name(type));
15361536

1537+
/* FIXME: We don't support concurrent channels with same peer. */
1538+
if (type == WIRE_OPEN_CHANNEL) {
1539+
struct channel_id channel_id;
1540+
1541+
if (extract_channel_id(msg, &channel_id)) {
1542+
u8 *reply;
1543+
1544+
reply = towire_errorfmt(msg, &channel_id,
1545+
"Opening multiple channels"
1546+
" unsupported");
1547+
enqueue_peer_msg(peer, take(reply));
1548+
return;
1549+
}
1550+
}
1551+
15371552
/* Must get funding_locked before almost anything. */
15381553
if (!peer->funding_locked[REMOTE]) {
15391554
/* We can get gossip before funding, too */

0 commit comments

Comments
 (0)