mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-17 19:03:42 +01:00
lightningd/gossip: use daemon_conn for status updates.
We're going to remove status_send (it's sync, and so doesn't play well with async io). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
1f894b6234
commit
3938f40274
@ -80,10 +80,12 @@ static void wake_pkt_out(struct peer *peer);
|
||||
static void destroy_peer(struct peer *peer)
|
||||
{
|
||||
list_del_from(&peer->daemon->peers, &peer->list);
|
||||
if (peer->error)
|
||||
status_send(towire_gossipstatus_peer_bad_msg(peer,
|
||||
peer->unique_id,
|
||||
(u8 *)peer->error));
|
||||
if (peer->error) {
|
||||
u8 *msg = towire_gossipstatus_peer_bad_msg(peer,
|
||||
peer->unique_id,
|
||||
(u8 *)peer->error);
|
||||
daemon_conn_send(&peer->daemon->master, take(msg));
|
||||
}
|
||||
}
|
||||
|
||||
static struct peer *setup_new_peer(struct daemon *daemon, const u8 *msg)
|
||||
@ -163,9 +165,9 @@ static struct io_plan *peer_msgin(struct io_conn *conn,
|
||||
s = towire_gossipstatus_peer_nongossip(msg, peer->unique_id,
|
||||
&peer->pcs.cs, msg);
|
||||
peer->local = false;
|
||||
status_send(s);
|
||||
status_send_fd(io_conn_fd(conn));
|
||||
return io_close(conn);
|
||||
daemon_conn_send(&peer->daemon->master, take(s));
|
||||
daemon_conn_send_fd(&peer->daemon->master, io_conn_fd(conn));
|
||||
return io_close_taken_fd(conn);
|
||||
}
|
||||
|
||||
/* BOLT #1:
|
||||
|
Loading…
Reference in New Issue
Block a user