connectd: return error when no common chain at init

This is useful for testing.
This commit is contained in:
darosior 2019-12-25 21:11:04 +01:00 committed by Christian Decker
parent 1e15e13de0
commit 77eb9e45b2

View file

@ -79,7 +79,9 @@ static struct io_plan *peer_init_received(struct io_conn *conn,
status_peer_debug(&peer->id,
"No common chain with this peer '%s', closing",
tal_hex(tmpctx, msg));
return io_close(conn);
msg = towire_errorfmt(NULL, NULL, "No common network");
msg = cryptomsg_encrypt_msg(NULL, &peer->cs, take(msg));
return io_write(conn, msg, tal_count(msg), io_close_cb, NULL);
}
}