mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
gossip: make connection own peer.
We steal it when we're closing connection, but we normally want to forget it if connection just dies. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
aef745e37d
commit
5fb1f20898
@ -379,6 +379,9 @@ static struct io_plan *new_peer_got_fd(struct io_conn *conn, struct peer *peer)
|
||||
if (!peer->conn) {
|
||||
peer->error = "Could not create connection";
|
||||
tal_free(peer);
|
||||
} else {
|
||||
/* If conn dies, we forget peer. */
|
||||
tal_steal(peer->conn, peer);
|
||||
}
|
||||
return daemon_conn_read_next(conn,&peer->daemon->master);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user