mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
peer: free init packet.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
6bda93f99a
commit
8a1559a343
@ -255,6 +255,8 @@ static struct io_plan *recv_body(struct io_conn *conn, struct peer *peer)
|
||||
{
|
||||
struct io_data *iod = peer->io_data;
|
||||
|
||||
assert(!peer->inpkt);
|
||||
|
||||
/* We have full packet. */
|
||||
peer->inpkt = decrypt_body(iod, iod, peer->log);
|
||||
if (!peer->inpkt)
|
||||
|
@ -2145,6 +2145,8 @@ static struct io_plan *init_pkt_in(struct io_conn *conn, struct peer *peer)
|
||||
}
|
||||
|
||||
/* Back into normal mode. */
|
||||
peer->inpkt = tal_free(peer->inpkt);
|
||||
|
||||
peer_has_connected(peer);
|
||||
return io_duplex(conn,
|
||||
peer_read_packet(conn, peer, pkt_in),
|
||||
@ -2432,6 +2434,7 @@ struct peer *new_peer(struct lightningd_state *dstate,
|
||||
peer->io_data = NULL;
|
||||
peer->secrets = NULL;
|
||||
list_head_init(&peer->watches);
|
||||
peer->inpkt = NULL;
|
||||
peer->outpkt = tal_arr(peer, Pkt *, 0);
|
||||
peer->open_jsoncmd = NULL;
|
||||
peer->commit_jsoncmd = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user