diff --git a/bitcoin/address.h b/bitcoin/address.h index b56572136..b17d1495a 100644 --- a/bitcoin/address.h +++ b/bitcoin/address.h @@ -1,7 +1,8 @@ #ifndef LIGHTNING_BITCOIN_ADDRESS_H #define LIGHTNING_BITCOIN_ADDRESS_H -#include +#include "config.h" #include +#include struct pubkey; diff --git a/bitcoin/base58.h b/bitcoin/base58.h index a8a8e1ebc..7111361d3 100644 --- a/bitcoin/base58.h +++ b/bitcoin/base58.h @@ -1,5 +1,7 @@ #ifndef LIGHTNING_BITCOIN_BASE58_H #define LIGHTNING_BITCOIN_BASE58_H +#include "config.h" + #include #include #include diff --git a/bitcoin/locktime.h b/bitcoin/locktime.h index 5c56ec554..dc33920e4 100644 --- a/bitcoin/locktime.h +++ b/bitcoin/locktime.h @@ -1,5 +1,6 @@ #ifndef LIGHTNING_BITCOIN_LOCKTIME_H #define LIGHTNING_BITCOIN_LOCKTIME_H +#include "config.h" #include #include diff --git a/bitcoin/privkey.h b/bitcoin/privkey.h index 4087eeae7..aee49ac58 100644 --- a/bitcoin/privkey.h +++ b/bitcoin/privkey.h @@ -1,5 +1,6 @@ #ifndef LIGHTNING_BITCOIN_PRIVKEY_H #define LIGHTNING_BITCOIN_PRIVKEY_H +#include "config.h" #include /* This is a private key. Keep it secret. */ diff --git a/bitcoin/pubkey.h b/bitcoin/pubkey.h index b75831348..2d9c5e7aa 100644 --- a/bitcoin/pubkey.h +++ b/bitcoin/pubkey.h @@ -1,8 +1,9 @@ #ifndef LIGHTNING_BITCOIN_PUBKEY_H #define LIGHTNING_BITCOIN_PUBKEY_H +#include "config.h" +#include "secp256k1.h" #include #include -#include "secp256k1.h" struct privkey; diff --git a/bitcoin/script.h b/bitcoin/script.h index 2a671450a..ae78f8139 100644 --- a/bitcoin/script.h +++ b/bitcoin/script.h @@ -1,8 +1,9 @@ #ifndef LIGHTNING_BITCOIN_SCRIPT_H #define LIGHTNING_BITCOIN_SCRIPT_H +#include "config.h" +#include "signature.h" #include #include -#include "signature.h" struct bitcoin_address; struct pubkey; diff --git a/bitcoin/shadouble.h b/bitcoin/shadouble.h index 7c1f6a404..f447df7f1 100644 --- a/bitcoin/shadouble.h +++ b/bitcoin/shadouble.h @@ -1,5 +1,6 @@ #ifndef LIGHTNING_BITCOIN_SHADOUBLE_H #define LIGHTNING_BITCOIN_SHADOUBLE_H +#include "config.h" #include /* To explicitly distinguish between single sha and bitcoin's standard double */ diff --git a/bitcoin/signature.h b/bitcoin/signature.h index 4822ebd49..c90632278 100644 --- a/bitcoin/signature.h +++ b/bitcoin/signature.h @@ -1,8 +1,9 @@ #ifndef LIGHTNING_BITCOIN_SIGNATURE_H #define LIGHTNING_BITCOIN_SIGNATURE_H +#include "config.h" +#include "secp256k1.h" #include #include -#include "secp256k1.h" enum sighash_type { SIGHASH_ALL = 1, diff --git a/bitcoin/tx.h b/bitcoin/tx.h index ad8ecd51e..965e99d79 100644 --- a/bitcoin/tx.h +++ b/bitcoin/tx.h @@ -1,8 +1,9 @@ #ifndef LIGHTNING_BITCOIN_TX_H #define LIGHTNING_BITCOIN_TX_H +#include "config.h" +#include "shadouble.h" #include #include -#include "shadouble.h" /* We unpack varints for our in-memory representation */ #define varint_t u64 diff --git a/close_tx.h b/close_tx.h index 52a9505f7..e1e274218 100644 --- a/close_tx.h +++ b/close_tx.h @@ -1,7 +1,8 @@ #ifndef LIGHTNING_CLOSE_TX_H #define LIGHTNING_CLOSE_TX_H -#include +#include "config.h" #include "lightning.pb-c.h" +#include struct sha256_double; diff --git a/commit_tx.h b/commit_tx.h index ab80e5989..8347c3142 100644 --- a/commit_tx.h +++ b/commit_tx.h @@ -1,7 +1,8 @@ #ifndef LIGHTNING_COMMIT_TX_H #define LIGHTNING_COMMIT_TX_H -#include +#include "config.h" #include "lightning.pb-c.h" +#include struct channel_state; struct sha256_double; diff --git a/find_p2sh_out.h b/find_p2sh_out.h index 5d2e1d0a0..5463499c0 100644 --- a/find_p2sh_out.h +++ b/find_p2sh_out.h @@ -1,5 +1,6 @@ #ifndef LIGHTNING_FIND_P2SH_OUT_H #define LIGHTNING_FIND_P2SH_OUT_H +#include "config.h" #include struct bitcoin_tx; diff --git a/funding.h b/funding.h index a1d4693a8..741495d89 100644 --- a/funding.h +++ b/funding.h @@ -1,10 +1,10 @@ #ifndef LIGHTNING_FUNDING_H #define LIGHTNING_FUNDING_H +#include "config.h" +#include "lightning.pb-c.h" #include #include -#include "lightning.pb-c.h" - struct channel_oneside { /* Payment and fee is in millisatoshi. */ uint32_t pay_msat, fee_msat; diff --git a/opt_bits.h b/opt_bits.h index 0e4e45e1e..8e8f6fed8 100644 --- a/opt_bits.h +++ b/opt_bits.h @@ -1,5 +1,6 @@ #ifndef LIGHTNING_OPT_BITS_H #define LIGHTNING_OPT_BITS_H +#include "config.h" #include #include diff --git a/overflows.h b/overflows.h index 1af031538..90b46ba5c 100644 --- a/overflows.h +++ b/overflows.h @@ -1,5 +1,6 @@ #ifndef LIGHTNING_OVERFLOWS_H #define LIGHTNING_OVERFLOWS_H +#include "config.h" static inline bool add_overflows_size_t(uint64_t a, uint64_t b) { diff --git a/permute_tx.h b/permute_tx.h index dd91786c5..a2fa94d37 100644 --- a/permute_tx.h +++ b/permute_tx.h @@ -1,5 +1,6 @@ #ifndef LIGHTNING_PERMUTE_TX_H #define LIGHTNING_PERMUTE_TX_H +#include "config.h" #include "bitcoin/tx.h" /* Permute the transaction into BIP69 order. diff --git a/pkt.h b/pkt.h index 9a6119f97..eacc9a44f 100644 --- a/pkt.h +++ b/pkt.h @@ -1,14 +1,16 @@ #ifndef LIGHTNING_PKT_H #define LIGHTNING_PKT_H +#include "config.h" + /* Simple (non-threadsafe!) wrapper for protobufs. * * This could be a simple set of macros, if the protobuf-c people hadn't * insisted on "prettifing" the names they generate into CamelCase. */ +#include "lightning.pb-c.h" #include #include #include -#include "lightning.pb-c.h" /* A packet, ready to be de-protobuf'ed. */ struct pkt { diff --git a/protobuf_convert.h b/protobuf_convert.h index 18a773284..f3b4a8f2f 100644 --- a/protobuf_convert.h +++ b/protobuf_convert.h @@ -1,8 +1,9 @@ #ifndef LIGHTNING_PROTOBUF_CONVERT_H #define LIGHTNING_PROTOBUF_CONVERT_H +#include "config.h" +#include "lightning.pb-c.h" #include #include -#include "lightning.pb-c.h" /* Convert to-from protobuf to internal representation. */ struct signature; diff --git a/state.h b/state.h index fdcc053dd..b096725be 100644 --- a/state.h +++ b/state.h @@ -1,8 +1,10 @@ #ifndef LIGHTNING_STATE_H #define LIGHTNING_STATE_H +#include "config.h" + +#include #include #include -#include enum cmd_complete_status { CMD_STATUS_ONGOING, diff --git a/state_types.h b/state_types.h index 9f41abd20..975d2fafb 100644 --- a/state_types.h +++ b/state_types.h @@ -1,5 +1,6 @@ #ifndef LIGHTNING_STATE_TYPES_H #define LIGHTNING_STATE_TYPES_H +#include "config.h" /* FIXME: cdump is really dumb, so we put these in their own header. */ #include "lightning.pb-c.h" diff --git a/version.h b/version.h index 8f688a0dc..d03ee013c 100644 --- a/version.h +++ b/version.h @@ -1,5 +1,6 @@ #ifndef LIGHTNING_VERSION_H #define LIGHTNING_VERSION_H +#include "config.h" #include char *version_and_exit(const void *unused);