connectd: keep timeout timer around so we can disable it.

connectd will be keeping the conn open, so it needs to free this
"conn_timeout" timer.  Pass it through, so we can do that.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-01-08 23:47:29 +10:30
parent 562e6c4a93
commit 7e7a63a20d
8 changed files with 58 additions and 23 deletions

View File

@@ -144,6 +144,7 @@ static struct io_plan *handshake_success(struct io_conn *conn,
const struct pubkey *them,
const struct wireaddr_internal *addr,
struct crypto_state *orig_cs,
struct oneshot *timer,
char **args)
{
u8 *msg;
@@ -351,7 +352,8 @@ int main(int argc, char *argv[])
if (connect(conn->fd, ai->ai_addr, ai->ai_addrlen) != 0)
err(1, "Connecting to %s", at+1);
initiator_handshake(conn, &us, &them, &addr, handshake_success, argv+2);
initiator_handshake(conn, &us, &them, &addr, NULL,
handshake_success, argv+2);
exit(0);
}