From 49809785cac22bbaeed9090c336dcb41f6503900 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 9 Nov 2016 08:04:27 +1030 Subject: [PATCH] state.h state_types.h: move into daemon/ Signed-off-by: Rusty Russell --- Makefile | 2 -- daemon/Makefile | 6 ++++-- state.h => daemon/state.h | 15 +++------------ state_types.h => daemon/state_types.h | 2 +- 4 files changed, 8 insertions(+), 17 deletions(-) rename state.h => daemon/state.h (83%) rename state_types.h => daemon/state_types.h (97%) diff --git a/Makefile b/Makefile index bb132b805..e986ba46a 100644 --- a/Makefile +++ b/Makefile @@ -156,8 +156,6 @@ CORE_HEADERS := close_tx.h \ permute_tx.h \ protobuf_convert.h \ remove_dust.h \ - state.h \ - state_types.h \ utils.h \ version.h diff --git a/daemon/Makefile b/daemon/Makefile index 0bca839fe..c2417561d 100644 --- a/daemon/Makefile +++ b/daemon/Makefile @@ -90,6 +90,8 @@ DAEMON_HEADERS := \ daemon/routing.h \ daemon/secrets.h \ daemon/sphinx.h \ + daemon/state.h \ + daemon/state_types.h \ daemon/timeout.h \ daemon/wallet.h \ daemon/watch.h @@ -100,8 +102,8 @@ daemon/gen_htlc_state_names.h: daemon/htlc_state.h ccan/ccan/cdump/tools/cdump-e daemon/gen_feechange_state_names.h: daemon/feechange_state.h ccan/ccan/cdump/tools/cdump-enumstr ccan/ccan/cdump/tools/cdump-enumstr daemon/feechange_state.h > $@ -daemon/gen_state_names.h: state_types.h ccan/ccan/cdump/tools/cdump-enumstr - ccan/ccan/cdump/tools/cdump-enumstr state_types.h > $@ +daemon/gen_state_names.h: daemon/state_types.h ccan/ccan/cdump/tools/cdump-enumstr + ccan/ccan/cdump/tools/cdump-enumstr daemon/state_types.h > $@ # lightning.pb-c.h doesn't create a named enum, just a typedef. Hack it. daemon/gen_pkt_names.h: lightning.pb-c.h ccan/ccan/cdump/tools/cdump-enumstr diff --git a/state.h b/daemon/state.h similarity index 83% rename from state.h rename to daemon/state.h index 175340027..9902bf950 100644 --- a/state.h +++ b/daemon/state.h @@ -1,19 +1,10 @@ -#ifndef LIGHTNING_STATE_H -#define LIGHTNING_STATE_H +#ifndef LIGHTNING_DAEMON_STATE_H +#define LIGHTNING_DAEMON_STATE_H #include "config.h" -#include -#include +#include "daemon/state_types.h" #include -/* - * This is the core state machine. - * - * Calling the state machine updates updates peer->state, and may call - * various peer_ callbacks. It also returns the status of the current - * command. - */ - static inline bool state_is_error(enum state s) { return s >= STATE_ERR_BREAKDOWN && s <= STATE_ERR_INTERNAL; diff --git a/state_types.h b/daemon/state_types.h similarity index 97% rename from state_types.h rename to daemon/state_types.h index 2286a492b..83d8e9dba 100644 --- a/state_types.h +++ b/daemon/state_types.h @@ -48,7 +48,7 @@ enum state { */ /* Bad packet from them / protocol breakdown. */ STATE_ERR_BREAKDOWN, - /* Their anchor didn't reach blockchain in reasonable time. */ + /* The anchor didn't reach blockchain in reasonable time. */ STATE_ERR_ANCHOR_TIMEOUT, /* We saw a tx we didn't sign. */ STATE_ERR_INFORMATION_LEAK,