diff --git a/connectd/connectd.c b/connectd/connectd.c index dc4ea050e6fd..fc52d4733b72 100644 --- a/connectd/connectd.c +++ b/connectd/connectd.c @@ -1812,21 +1812,10 @@ static void peer_final_msg(struct io_conn *conn, struct peer *peer; struct node_id id; u8 *finalmsg; - int peer_fd; if (!fromwire_connectd_peer_final_msg(tmpctx, msg, &id, &finalmsg)) master_badmsg(WIRE_CONNECTD_PEER_FINAL_MSG, msg); - /* Get the peer_fd for this peer: we don't need it though! */ - io_fd_block(io_conn_fd(conn), true); - peer_fd = fdpass_recv(io_conn_fd(conn)); - if (peer_fd == -1) - status_failed(STATUS_FAIL_MASTER_IO, - "Getting peer fd after peer_final_msg: %s", - strerror(errno)); - close(peer_fd); - io_fd_block(io_conn_fd(conn), false); - /* This can happen if peer hung up on us. */ peer = peer_htable_get(&daemon->peers, &id); if (peer) { diff --git a/connectd/connectd_wire.csv b/connectd/connectd_wire.csv index c735f3c93173..7632a2840e43 100644 --- a/connectd/connectd_wire.csv +++ b/connectd/connectd_wire.csv @@ -72,7 +72,7 @@ msgdata,connectd_peer_connected,features,u8,flen msgtype,connectd_peer_disconnected,2015 msgdata,connectd_peer_disconnected,id,node_id, -# master -> connectd: give message to peer and disconnect. Plus fd for peer +# master -> connectd: give message to peer and disconnect. msgtype,connectd_peer_final_msg,2003 msgdata,connectd_peer_final_msg,id,node_id, msgdata,connectd_peer_final_msg,len,u16, diff --git a/lightningd/opening_common.c b/lightningd/opening_common.c index e817d6967d60..90a134f685ec 100644 --- a/lightningd/opening_common.c +++ b/lightningd/opening_common.c @@ -194,7 +194,7 @@ void handle_reestablish(struct lightningd *ld, subd_send_msg(ld->connectd, take(towire_connectd_peer_final_msg(NULL, peer_id, err))); - subd_send_fd(ld->connectd, peer_fd); + close(peer_fd); } } diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index 9d0137657cd5..40a2b4c38b6a 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -1057,7 +1057,7 @@ static void peer_connected_hook_final(struct peer_connected_hook_payload *payloa subd_send_msg(ld->connectd, take(towire_connectd_peer_final_msg(NULL, &peer->id, error))); - subd_send_fd(ld->connectd, payload->peer_fd); + close(payload->peer_fd); } static bool