Browse Source

hsm: remove shutdown command.

We don't use it, and should shutdown when control fd goes away anyway.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 8 years ago
parent
commit
19f3b68d28
  1. 13
      lightningd/hsm/hsm.c
  2. 3
      lightningd/hsm/hsm_control_wire_csv

13
lightningd/hsm/hsm.c

@ -276,9 +276,6 @@ static struct io_plan *control_received_req(struct io_conn *conn,
control->out = pass_hsmfd_ecdh(conn, control, control->in,
&control->out_fd);
goto send_out;
case WIRE_HSMCTL_SHUTDOWN:
io_break(control);
return io_never(conn, control);
case WIRE_HSMCTL_INIT_RESPONSE:
case WIRE_HSMCTL_HSMFD_FD_RESPONSE:
@ -301,6 +298,12 @@ static struct io_plan *control_init(struct io_conn *conn,
return recv_req(conn, control);
}
/* Exit when control fd closes. */
static void control_finish(struct io_conn *conn, struct conn_info *control)
{
io_break(control);
}
#ifndef TESTING
int main(int argc, char *argv[])
{
@ -321,7 +324,9 @@ int main(int argc, char *argv[])
/* Stdout == status, stdin == requests */
status_setup(STDOUT_FILENO);
io_new_conn(control, STDIN_FILENO, control_init, control);
io_set_finish(io_new_conn(control, STDIN_FILENO, control_init, control),
control_finish, control);
io_loop(NULL, NULL);
tal_free(control);

3
lightningd/hsm/hsm_control_wire_csv

@ -11,6 +11,3 @@ hsmctl_hsmfd_ecdh,0,unique_id,8
# No message, just an fd.
hsmctl_hsmfd_fd_response,103
# Shutdown just results in an exit.
hsmctl_shutdown,4

Loading…
Cancel
Save