Skip to content

Commit 77eb9e4

Browse files
darosiorcdecker
authored andcommitted
connectd: return error when no common chain at init
This is useful for testing.
1 parent 1e15e13 commit 77eb9e4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

connectd/peer_exchange_initmsg.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ static struct io_plan *peer_init_received(struct io_conn *conn,
7979
status_peer_debug(&peer->id,
8080
"No common chain with this peer '%s', closing",
8181
tal_hex(tmpctx, msg));
82-
return io_close(conn);
82+
msg = towire_errorfmt(NULL, NULL, "No common network");
83+
msg = cryptomsg_encrypt_msg(NULL, &peer->cs, take(msg));
84+
return io_write(conn, msg, tal_count(msg), io_close_cb, NULL);
8385
}
8486
}
8587

0 commit comments

Comments
 (0)