From 400d4151726c4e474526cb1ab54f64a7d612771d Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 26 May 2016 15:25:25 +0930 Subject: [PATCH] daemon: remove pending input and command queues. we don't use them any more. Signed-off-by: Rusty Russell --- daemon/peer.c | 35 ----------------------------------- daemon/peer.h | 6 ------ 2 files changed, 41 deletions(-) diff --git a/daemon/peer.c b/daemon/peer.c index fe1970758..97e16ecdc 100644 --- a/daemon/peer.c +++ b/daemon/peer.c @@ -49,18 +49,6 @@ struct json_connecting { struct anchor_input *input; }; -struct pending_cmd { - struct list_node list; - void (*dequeue)(struct peer *, void *arg); - void *arg; -}; - -struct pending_input { - struct list_node list; - enum state_input input; - union input idata; -}; - static struct peer *find_peer(struct lightningd_state *dstate, const char *buffer, jsmntok_t *peeridtok) @@ -574,24 +562,10 @@ static void state_single(struct peer *peer, io_break(peer); } -static void UNNEEDED queue_input(struct peer *peer, - enum state_input input, - const union input *idata) -{ - struct pending_input *pend = tal(peer, struct pending_input); - - pend->input = input; - if (idata) - pend->idata = *idata; - list_add_tail(&peer->pending_input, &pend->list); -} - static void state_event(struct peer *peer, const enum state_input input, const union input *idata) { - struct pending_input *pend; - if (!state_is_opening(peer->state) && !state_is_normal(peer->state)) { log_unusual(peer->log, "Unexpected input %s while state %s", @@ -599,12 +573,6 @@ static void state_event(struct peer *peer, } else { state_single(peer, input, idata); } - - pend = list_pop(&peer->pending_input, struct pending_input, list); - if (pend) { - state_event(peer, pend->input, &pend->idata); - tal_free(pend); - } } static struct io_plan *pkt_out(struct io_conn *conn, struct peer *peer) @@ -772,8 +740,6 @@ static struct peer *new_peer(struct lightningd_state *dstate, list_head_init(&peer->watches); peer->outpkt = tal_arr(peer, Pkt *, 0); peer->commit_jsoncmd = NULL; - list_head_init(&peer->pending_cmd); - list_head_init(&peer->pending_input); list_head_init(&peer->outgoing_txs); peer->close_watch_timeout = NULL; peer->anchor.watches = NULL; @@ -2276,7 +2242,6 @@ static void json_add_htlcs(struct json_result *response, /* FIXME: add history command which shows all prior and current commit txs */ /* FIXME: Somehow we should show running DNS lookups! */ -/* FIXME: Show status of peers! */ static void json_getpeers(struct command *cmd, const char *buffer, const jsmntok_t *params) { diff --git a/daemon/peer.h b/daemon/peer.h index 1160858c3..01394cd71 100644 --- a/daemon/peer.h +++ b/daemon/peer.h @@ -124,12 +124,6 @@ struct peer { /* If we're doing a commit, this is the command which triggered it */ struct command *commit_jsoncmd; - /* Pending inputs. */ - struct list_head pending_input; - - /* Pending commands. */ - struct list_head pending_cmd; - /* Global state. */ struct lightningd_state *dstate;