From 03e7be5bcec8d4536b251ba5593d3ee4419b936c Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 19 Oct 2018 11:47:48 +1030 Subject: [PATCH] json_connection: keep pointer to the conn. This is required for our next hack. Signed-off-by: Rusty Russell --- lightningd/jsonrpc.c | 1 + lightningd/jsonrpc.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/lightningd/jsonrpc.c b/lightningd/jsonrpc.c index 79751ff1b..207d308a6 100644 --- a/lightningd/jsonrpc.c +++ b/lightningd/jsonrpc.c @@ -621,6 +621,7 @@ static struct io_plan *jcon_connected(struct io_conn *conn, struct json_connection *jcon; jcon = tal(conn, struct json_connection); + jcon->conn = conn; jcon->ld = ld; jcon->used = 0; jcon->buffer = tal_arr(jcon, char, 64); diff --git a/lightningd/jsonrpc.h b/lightningd/jsonrpc.h index f829d43c3..c297df99a 100644 --- a/lightningd/jsonrpc.h +++ b/lightningd/jsonrpc.h @@ -50,6 +50,9 @@ struct json_connection { /* The global state */ struct lightningd *ld; + /* This io_conn (and our owner!) */ + struct io_conn *conn; + /* Logging for this json connection. */ struct log *log;