diff --git a/bitcoin/base58.c b/bitcoin/base58.c index 05828b5b7..e874b0b8e 100644 --- a/bitcoin/base58.c +++ b/bitcoin/base58.c @@ -3,11 +3,12 @@ // Copyright (c) 2009-2012 The Bitcoin Developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "address.h" -#include "base58.h" -#include "privkey.h" -#include "pubkey.h" -#include "shadouble.h" +#include "config.h" +#include +#include +#include +#include +#include #include #include diff --git a/bitcoin/chainparams.c b/bitcoin/chainparams.c index 2f61badba..d253e04ac 100644 --- a/bitcoin/chainparams.c +++ b/bitcoin/chainparams.c @@ -1,4 +1,5 @@ -#include "chainparams.h" +#include "config.h" +#include #include #include #include diff --git a/bitcoin/feerate.c b/bitcoin/feerate.c index 88c4af762..fc7342394 100644 --- a/bitcoin/feerate.c +++ b/bitcoin/feerate.c @@ -1,3 +1,4 @@ +#include "config.h" #include u32 feerate_from_style(u32 feerate, enum feerate_style style) diff --git a/bitcoin/preimage.c b/bitcoin/preimage.c index ce7d69a18..8fcafa01d 100644 --- a/bitcoin/preimage.c +++ b/bitcoin/preimage.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include diff --git a/bitcoin/privkey.c b/bitcoin/privkey.c index e250a1313..646d655a9 100644 --- a/bitcoin/privkey.c +++ b/bitcoin/privkey.c @@ -1,4 +1,5 @@ -#include "privkey.h" +#include "config.h" +#include #include #include #include diff --git a/bitcoin/pubkey.c b/bitcoin/pubkey.c index 2e26259ec..80807813f 100644 --- a/bitcoin/pubkey.c +++ b/bitcoin/pubkey.c @@ -1,6 +1,7 @@ -#include "privkey.h" -#include "pubkey.h" +#include "config.h" #include +#include +#include #include #include #include diff --git a/bitcoin/script.c b/bitcoin/script.c index 6a3e6f8c4..805a44a96 100644 --- a/bitcoin/script.c +++ b/bitcoin/script.c @@ -1,9 +1,10 @@ -#include "address.h" -#include "locktime.h" -#include "preimage.h" -#include "pubkey.h" -#include "script.h" +#include "config.h" #include +#include +#include +#include +#include +#include #include #include #include diff --git a/bitcoin/shadouble.c b/bitcoin/shadouble.c index 775b89343..fb7299804 100644 --- a/bitcoin/shadouble.c +++ b/bitcoin/shadouble.c @@ -1,4 +1,5 @@ -#include "shadouble.h" +#include "config.h" +#include #include #include #include diff --git a/bitcoin/short_channel_id.c b/bitcoin/short_channel_id.c index d67004d83..ff77ee2ac 100644 --- a/bitcoin/short_channel_id.c +++ b/bitcoin/short_channel_id.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/bitcoin/signature.c b/bitcoin/signature.c index c835c680c..4e0cda8ad 100644 --- a/bitcoin/signature.c +++ b/bitcoin/signature.c @@ -1,11 +1,12 @@ -#include "privkey.h" -#include "pubkey.h" -#include "script.h" -#include "shadouble.h" -#include "signature.h" -#include "tx.h" +#include "config.h" #include +#include #include +#include +#include +#include +#include +#include #include #include #include diff --git a/bitcoin/test/run-bitcoin_block_from_hex.c b/bitcoin/test/run-bitcoin_block_from_hex.c index c4a23dfc9..c00d99778 100644 --- a/bitcoin/test/run-bitcoin_block_from_hex.c +++ b/bitcoin/test/run-bitcoin_block_from_hex.c @@ -1,3 +1,4 @@ +#include "config.h" #include "../block.c" #include "../psbt.c" #include "../shadouble.c" diff --git a/bitcoin/varint.c b/bitcoin/varint.c index 290e28586..4852af2ed 100644 --- a/bitcoin/varint.c +++ b/bitcoin/varint.c @@ -1,4 +1,5 @@ -#include "varint.h" +#include "config.h" +#include size_t varint_size(varint_t v) { diff --git a/ccan_compat.h b/ccan_compat.h index f0337f33f..565327eaf 100644 --- a/ccan_compat.h +++ b/ccan_compat.h @@ -1,7 +1,12 @@ #ifndef LIGHTNING_CCAN_COMPAT_H #define LIGHTNING_CCAN_COMPAT_H + /* Magical file included from config.h (ie. everywhere) which renames * sha256 routines so they don't clash with libwally-core's internal ones */ + +/* So, for obvious reasons, this is an exception to the usual rule that we +#include "config.h" + * in all files. */ #define sha256(sha, p, size) ccan_sha256(sha, p, size) #define sha256_init(ctx) ccan_sha256_init(ctx) #define sha256_update(ctx, p, size) ccan_sha256_update(ctx, p, size) diff --git a/channeld/channeld.c b/channeld/channeld.c index 7849a24a8..895d92131 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -10,6 +10,7 @@ * reading and writing synchronously we could deadlock if we hit buffer * limits, unlikely as that is. */ +#include "config.h" #include #include #include diff --git a/channeld/commit_tx.c b/channeld/commit_tx.c index 9c2f7499f..1e87ae6ee 100644 --- a/channeld/commit_tx.c +++ b/channeld/commit_tx.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/channeld/test/run-commit_tx.c b/channeld/test/run-commit_tx.c index 7dfeed50c..7610fbd9a 100644 --- a/channeld/test/run-commit_tx.c +++ b/channeld/test/run-commit_tx.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/channeld/test/run-full_channel.c b/channeld/test/run-full_channel.c index 1212f596f..2a5112dee 100644 --- a/channeld/test/run-full_channel.c +++ b/channeld/test/run-full_channel.c @@ -1,3 +1,4 @@ +#include "config.h" #include "../../common/blockheight_states.c" #include "../../common/channel_id.c" #include "../../common/fee_states.c" diff --git a/channeld/watchtower.c b/channeld/watchtower.c index cdf11a106..a895dfc1d 100644 --- a/channeld/watchtower.c +++ b/channeld/watchtower.c @@ -1,7 +1,7 @@ -#include "watchtower.h" - +#include "config.h" #include #include +#include #include #include #include diff --git a/closingd/closingd.c b/closingd/closingd.c index 10a8279d2..b3f54e3b7 100644 --- a/closingd/closingd.c +++ b/closingd/closingd.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/addr.c b/common/addr.c index c1ff6ce10..bbe073c97 100644 --- a/common/addr.c +++ b/common/addr.c @@ -1,7 +1,8 @@ -#include "addr.h" +#include "config.h" #include #include #include +#include #include char *encode_scriptpubkey_to_addr(const tal_t *ctx, diff --git a/common/base32.c b/common/base32.c index efe3dad6e..b6658bc46 100644 --- a/common/base32.c +++ b/common/base32.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include diff --git a/common/bech32.c b/common/bech32.c index de8b05302..7e949f6c3 100644 --- a/common/bech32.c +++ b/common/bech32.c @@ -21,9 +21,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#include "bech32.h" - +#include "config.h" #include +#include #include static uint32_t bech32_polymod_step(uint32_t pre) { diff --git a/common/bech32_util.c b/common/bech32_util.c index 26168b814..ed6b51d02 100644 --- a/common/bech32_util.c +++ b/common/bech32_util.c @@ -1,6 +1,7 @@ -#include "bech32_util.h" +#include "config.h" #include #include +#include static u8 get_bit(const u8 *src, size_t bitoff) { diff --git a/common/billboard.c b/common/billboard.c index a9f178e70..04a685e36 100644 --- a/common/billboard.c +++ b/common/billboard.c @@ -1,5 +1,6 @@ -#include "billboard.h" +#include "config.h" #include +#include #include char *billboard_message(const tal_t *ctx, diff --git a/common/bip32.c b/common/bip32.c index f4be88500..3a29d9bda 100644 --- a/common/bip32.c +++ b/common/bip32.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/blindedpath.c b/common/blindedpath.c index 7994813b7..7b60c0f0c 100644 --- a/common/blindedpath.c +++ b/common/blindedpath.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/blinding.c b/common/blinding.c index e74312c40..b92c731c0 100644 --- a/common/blinding.c +++ b/common/blinding.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/blockheight_states.c b/common/blockheight_states.c index 3a5a151d1..b8f1843d7 100644 --- a/common/blockheight_states.c +++ b/common/blockheight_states.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/bolt11.c b/common/bolt11.c index 09bb2e433..19be87a69 100644 --- a/common/bolt11.c +++ b/common/bolt11.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/bolt11_json.c b/common/bolt11_json.c index b66dd5de3..a97577e94 100644 --- a/common/bolt11_json.c +++ b/common/bolt11_json.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/bolt12.c b/common/bolt12.c index 5ab64f31e..6fa064bdc 100644 --- a/common/bolt12.c +++ b/common/bolt12.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/bolt12_merkle.c b/common/bolt12_merkle.c index d9085f86c..575529f61 100644 --- a/common/bolt12_merkle.c +++ b/common/bolt12_merkle.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/channel_config.c b/common/channel_config.c index c4e991f49..55e32ae6d 100644 --- a/common/channel_config.c +++ b/common/channel_config.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include diff --git a/common/channel_id.c b/common/channel_id.c index 726297fa4..517427b74 100644 --- a/common/channel_id.c +++ b/common/channel_id.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/channel_type.c b/common/channel_type.c index 890b191c6..87f0ab2bc 100644 --- a/common/channel_type.c +++ b/common/channel_type.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include diff --git a/common/close_tx.c b/common/close_tx.c index 236d7abab..e1eb16ba6 100644 --- a/common/close_tx.c +++ b/common/close_tx.c @@ -1,8 +1,8 @@ -#include "bitcoin/script.h" -#include "bitcoin/tx.h" -#include "close_tx.h" -#include "permute_tx.h" +#include "config.h" #include +#include +#include +#include #include struct bitcoin_tx *create_close_tx(const tal_t *ctx, diff --git a/common/configdir.c b/common/configdir.c index c71c001ff..c03abe18c 100644 --- a/common/configdir.c +++ b/common/configdir.c @@ -1,4 +1,4 @@ -#include "configdir.h" +#include "config.h" #include #include #include @@ -7,6 +7,7 @@ #include #include #include +#include #include #include diff --git a/common/crypto_state.c b/common/crypto_state.c index f056afc64..d592ddfd3 100644 --- a/common/crypto_state.c +++ b/common/crypto_state.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include diff --git a/common/crypto_sync.c b/common/crypto_sync.c index ad24251a0..93733884b 100644 --- a/common/crypto_sync.c +++ b/common/crypto_sync.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/daemon_conn.c b/common/daemon_conn.c index 9d77f3729..0a9a1ef25 100644 --- a/common/daemon_conn.c +++ b/common/daemon_conn.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/decode_array.c b/common/decode_array.c index c4df6f103..8093282b7 100644 --- a/common/decode_array.c +++ b/common/decode_array.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/derive_basepoints.c b/common/derive_basepoints.c index 3b708da35..cbb3b6525 100644 --- a/common/derive_basepoints.c +++ b/common/derive_basepoints.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/descriptor_checksum.c b/common/descriptor_checksum.c index a29aec86d..14487cb65 100644 --- a/common/descriptor_checksum.c +++ b/common/descriptor_checksum.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/dijkstra.c b/common/dijkstra.c index e4d9c0ead..5607a1c60 100644 --- a/common/dijkstra.c +++ b/common/dijkstra.c @@ -1,5 +1,6 @@ /* Without this, gheap is *really* slow! Comment out for debugging. */ #define NDEBUG +#include "config.h" #include #include #include diff --git a/common/ecdh_hsmd.c b/common/ecdh_hsmd.c index d8afac9b9..b8546ea99 100644 --- a/common/ecdh_hsmd.c +++ b/common/ecdh_hsmd.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/features.c b/common/features.c index f84375989..6647e7ff7 100644 --- a/common/features.c +++ b/common/features.c @@ -1,7 +1,8 @@ -#include "features.h" +#include "config.h" #include #include #include +#include #include enum feature_copy_style { diff --git a/common/fee_states.c b/common/fee_states.c index 451d3849f..4176972f8 100644 --- a/common/fee_states.c +++ b/common/fee_states.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/gossip_rcvd_filter.c b/common/gossip_rcvd_filter.c index cf8e942d2..0c6b3d350 100644 --- a/common/gossip_rcvd_filter.c +++ b/common/gossip_rcvd_filter.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/hash_u5.c b/common/hash_u5.c index 00a1dea57..7e23a0da6 100644 --- a/common/hash_u5.c +++ b/common/hash_u5.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/hmac.c b/common/hmac.c index 8cd7436f8..3b83e3b28 100644 --- a/common/hmac.c +++ b/common/hmac.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/hsm_encryption.c b/common/hsm_encryption.c index 7e5778854..b66c3ea87 100644 --- a/common/hsm_encryption.c +++ b/common/hsm_encryption.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/htlc_state.c b/common/htlc_state.c index 4a0e6312b..75b841d38 100644 --- a/common/htlc_state.c +++ b/common/htlc_state.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include "htlc_state_names_gen.h" diff --git a/common/htlc_trim.c b/common/htlc_trim.c index dccfd26d9..711f9ec7d 100644 --- a/common/htlc_trim.c +++ b/common/htlc_trim.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include diff --git a/common/htlc_tx.c b/common/htlc_tx.c index 53ec9ab13..50552128c 100644 --- a/common/htlc_tx.c +++ b/common/htlc_tx.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/htlc_wire.c b/common/htlc_wire.c index 801c8124b..3a175e832 100644 --- a/common/htlc_wire.c +++ b/common/htlc_wire.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/initial_commit_tx.c b/common/initial_commit_tx.c index b2c9e956d..6da3fa3a0 100644 --- a/common/initial_commit_tx.c +++ b/common/initial_commit_tx.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/io_lock.c b/common/io_lock.c index d32a510d0..05caaafbe 100644 --- a/common/io_lock.c +++ b/common/io_lock.c @@ -1,6 +1,7 @@ -#include "io_lock.h" +#include "config.h" #include #include +#include struct io_lock { bool locked; diff --git a/common/iso4217.c b/common/iso4217.c index f00ade86e..a164e91c4 100644 --- a/common/iso4217.c +++ b/common/iso4217.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/json_helpers.c b/common/json_helpers.c index ee7f23531..17ee69935 100644 --- a/common/json_helpers.c +++ b/common/json_helpers.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/json_stream.c b/common/json_stream.c index 48c7c7726..0025eb5b8 100644 --- a/common/json_stream.c +++ b/common/json_stream.c @@ -1,3 +1,4 @@ +#include "config.h" #include /* To reach into io_plan: not a public header! */ #include diff --git a/common/json_tok.c b/common/json_tok.c index ad159cfd1..ad88451eb 100644 --- a/common/json_tok.c +++ b/common/json_tok.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/key_derive.c b/common/key_derive.c index 732a121fd..b5ed2424b 100644 --- a/common/key_derive.c +++ b/common/key_derive.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/keyset.c b/common/keyset.c index 680d891c4..9630c76f7 100644 --- a/common/keyset.c +++ b/common/keyset.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/onion.c b/common/onion.c index aeab17de1..69e0e32db 100644 --- a/common/onion.c +++ b/common/onion.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/onionreply.c b/common/onionreply.c index 2d4c4c1b8..6a6e58ff9 100644 --- a/common/onionreply.c +++ b/common/onionreply.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/param.c b/common/param.c index 40e5f0abb..5c3b30ad5 100644 --- a/common/param.c +++ b/common/param.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/peer_billboard.c b/common/peer_billboard.c index 7ed816eb2..840e97c7b 100644 --- a/common/peer_billboard.c +++ b/common/peer_billboard.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/peer_failed.c b/common/peer_failed.c index a6b0c55cd..97ec96cfa 100644 --- a/common/peer_failed.c +++ b/common/peer_failed.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/permute_tx.c b/common/permute_tx.c index 3ab7aff73..bf97206d5 100644 --- a/common/permute_tx.c +++ b/common/permute_tx.c @@ -1,4 +1,5 @@ -#include "permute_tx.h" +#include "config.h" +#include #include static bool input_better(const struct wally_tx_input *a, diff --git a/common/ping.c b/common/ping.c index bcb2f2555..e7a32eebd 100644 --- a/common/ping.c +++ b/common/ping.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/psbt_internal.c b/common/psbt_internal.c index 0a034ddc8..19460f01e 100644 --- a/common/psbt_internal.c +++ b/common/psbt_internal.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/pseudorand.c b/common/pseudorand.c index 6e9a5d214..c08e21849 100644 --- a/common/pseudorand.c +++ b/common/pseudorand.c @@ -1,9 +1,10 @@ -#include "pseudorand.h" +#include "config.h" #include #include #include #include #include +#include #include #include diff --git a/common/random_select.c b/common/random_select.c index 1acaeb005..47b5407f2 100644 --- a/common/random_select.c +++ b/common/random_select.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include diff --git a/common/shutdown_scriptpubkey.c b/common/shutdown_scriptpubkey.c index ceaf5dde3..866931ee5 100644 --- a/common/shutdown_scriptpubkey.c +++ b/common/shutdown_scriptpubkey.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include diff --git a/common/socket_close.c b/common/socket_close.c index cf9cbcf98..3c192e47e 100644 --- a/common/socket_close.c +++ b/common/socket_close.c @@ -1,5 +1,6 @@ -#include "socket_close.h" +#include "config.h" #include +#include #include #include #include diff --git a/common/status_levels.c b/common/status_levels.c index 99ddfd890..8746ec8d9 100644 --- a/common/status_levels.c +++ b/common/status_levels.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include diff --git a/common/status_wire.c b/common/status_wire.c index 25afd376b..26ad92526 100644 --- a/common/status_wire.c +++ b/common/status_wire.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include diff --git a/common/subdaemon.c b/common/subdaemon.c index 24b0a0a21..6ed2e4438 100644 --- a/common/subdaemon.c +++ b/common/subdaemon.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/test/run-amount.c b/common/test/run-amount.c index 780377574..de4ac8458 100644 --- a/common/test/run-amount.c +++ b/common/test/run-amount.c @@ -1,3 +1,4 @@ +#include "config.h" #include "../amount.c" #include #include diff --git a/common/test/run-base64.c b/common/test/run-base64.c index 899e83b6b..3261d998f 100644 --- a/common/test/run-base64.c +++ b/common/test/run-base64.c @@ -1,3 +1,4 @@ +#include "config.h" #include "../base64.c" #include #include diff --git a/common/test/run-bigsize.c b/common/test/run-bigsize.c index bf60a2f3d..85c82a2ac 100644 --- a/common/test/run-bigsize.c +++ b/common/test/run-bigsize.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/test/run-blindedpath_enctlv.c b/common/test/run-blindedpath_enctlv.c index f0e0a36d9..a1d32e5a3 100644 --- a/common/test/run-blindedpath_enctlv.c +++ b/common/test/run-blindedpath_enctlv.c @@ -1,3 +1,4 @@ +#include "config.h" #include "../bigsize.c" #include "../blinding.c" #include "../hmac.c" diff --git a/common/test/run-blindedpath_onion.c b/common/test/run-blindedpath_onion.c index f20058b81..191e157af 100644 --- a/common/test/run-blindedpath_onion.c +++ b/common/test/run-blindedpath_onion.c @@ -1,4 +1,5 @@ /* Pipe through jq for test vector! */ +#include "config.h" #include "../bigsize.c" #include "../blindedpath.c" #include "../blinding.c" diff --git a/common/test/run-bolt11.c b/common/test/run-bolt11.c index 0a0862eef..2dbb1bd7e 100644 --- a/common/test/run-bolt11.c +++ b/common/test/run-bolt11.c @@ -1,3 +1,4 @@ +#include "config.h" #include "../amount.c" #include "../bech32.c" #include "../bech32_util.c" diff --git a/common/test/run-bolt12_merkle.c b/common/test/run-bolt12_merkle.c index 4799255fc..1610e3ea8 100644 --- a/common/test/run-bolt12_merkle.c +++ b/common/test/run-bolt12_merkle.c @@ -1,4 +1,5 @@ #define SUPERVERBOSE printf +#include "config.h" /* Needed before including bolt12_merkle.c: */ #include #include diff --git a/common/test/run-bolt12_period.c b/common/test/run-bolt12_period.c index 556cf51b2..e82ab6a0d 100644 --- a/common/test/run-bolt12_period.c +++ b/common/test/run-bolt12_period.c @@ -1,3 +1,4 @@ +#include "config.h" #include "../bolt12.c" #include "../json.c" #include diff --git a/common/test/run-cryptomsg.c b/common/test/run-cryptomsg.c index a072c2806..963e49648 100644 --- a/common/test/run-cryptomsg.c +++ b/common/test/run-cryptomsg.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/test/run-derive_basepoints.c b/common/test/run-derive_basepoints.c index 5e2a636ff..e7ebaab86 100644 --- a/common/test/run-derive_basepoints.c +++ b/common/test/run-derive_basepoints.c @@ -1,3 +1,4 @@ +#include "config.h" #include "../derive_basepoints.c" #include #include diff --git a/common/test/run-features.c b/common/test/run-features.c index fefc3f78a..e93870521 100644 --- a/common/test/run-features.c +++ b/common/test/run-features.c @@ -1,3 +1,4 @@ +#include "config.h" #include "../features.c" #include "../memleak.c" #include diff --git a/common/test/run-gossip_rcvd_filter.c b/common/test/run-gossip_rcvd_filter.c index e15c098ee..270df9bd4 100644 --- a/common/test/run-gossip_rcvd_filter.c +++ b/common/test/run-gossip_rcvd_filter.c @@ -1,3 +1,4 @@ +#include "config.h" #include "../gossip_rcvd_filter.c" #include "../pseudorand.c" #include "../../wire/fromwire.c" diff --git a/common/test/run-gossmap-fp16.c b/common/test/run-gossmap-fp16.c index 5b96d3681..a3df4b47f 100644 --- a/common/test/run-gossmap-fp16.c +++ b/common/test/run-gossmap-fp16.c @@ -1,3 +1,4 @@ +#include "config.h" #include "../fp16.c" #include #include diff --git a/common/test/run-gossmap_guess_node_id.c b/common/test/run-gossmap_guess_node_id.c index f87204a6b..8b4188bc5 100644 --- a/common/test/run-gossmap_guess_node_id.c +++ b/common/test/run-gossmap_guess_node_id.c @@ -1,4 +1,5 @@ /* Test conversion assumptions used by gossmap_guess_node_id */ +#include "config.h" #include "../node_id.c" #include #include diff --git a/common/test/run-gossmap_local.c b/common/test/run-gossmap_local.c index 20b08d562..605c2cb8d 100644 --- a/common/test/run-gossmap_local.c +++ b/common/test/run-gossmap_local.c @@ -1,4 +1,5 @@ /* Test local modifications to gossmap */ +#include "config.h" #include "../amount.c" #include "../fp16.c" #include "../gossmap.c" diff --git a/common/test/run-ip_port_parsing.c b/common/test/run-ip_port_parsing.c index 090b7f235..2be030de6 100644 --- a/common/test/run-ip_port_parsing.c +++ b/common/test/run-ip_port_parsing.c @@ -1,3 +1,4 @@ +#include "config.h" #include "../common/base32.c" #include "../common/wireaddr.c" diff --git a/common/test/run-json.c b/common/test/run-json.c index c1e51ba2f..711368786 100644 --- a/common/test/run-json.c +++ b/common/test/run-json.c @@ -1,3 +1,4 @@ +#include "config.h" #include "../json_helpers.c" #include #include diff --git a/common/test/run-json_scan.c b/common/test/run-json_scan.c index bd76b3447..2da211996 100644 --- a/common/test/run-json_scan.c +++ b/common/test/run-json_scan.c @@ -1,3 +1,4 @@ +#include "config.h" #include "../json.c" #include #include diff --git a/common/test/run-key_derive.c b/common/test/run-key_derive.c index dd3c7c3d9..3c98cb50b 100644 --- a/common/test/run-key_derive.c +++ b/common/test/run-key_derive.c @@ -1,5 +1,6 @@ #define SUPERVERBOSE +#include "config.h" #include #include #include diff --git a/common/test/run-lease_rates.c b/common/test/run-lease_rates.c index 08155e4ed..034134bf0 100644 --- a/common/test/run-lease_rates.c +++ b/common/test/run-lease_rates.c @@ -1,3 +1,4 @@ +#include "config.h" #include "../amount.c" #include "../lease_rates.c" #include diff --git a/common/test/run-lock.c b/common/test/run-lock.c index 579f99b71..36e5323a9 100644 --- a/common/test/run-lock.c +++ b/common/test/run-lock.c @@ -1,3 +1,4 @@ +#include "config.h" #include "../io_lock.c" #include #include diff --git a/common/test/run-route-specific.c b/common/test/run-route-specific.c index 33ab55dce..e58ef4689 100644 --- a/common/test/run-route-specific.c +++ b/common/test/run-route-specific.c @@ -5,6 +5,7 @@ * getchannels: * {'channels': [{'active': True, 'short_id': '6990x2x1/1', 'fee_per_kw': 10, 'delay': 5, 'message_flags': 0, 'channel_flags': 1, 'destination': '0230ad0e74ea03976b28fda587bb75bdd357a1938af4424156a18265167f5e40ae', 'source': '02ea622d5c8d6143f15ed3ce1d501dd0d3d09d3b1c83a44d0034949f8a9ab60f06', 'last_update': 1504064344}, {'active': True, 'short_id': '6989x2x1/0', 'fee_per_kw': 10, 'delay': 5, 'message_flags': 0, 'channel_flags': 0, 'destination': '03c173897878996287a8100469f954dd820fcd8941daed91c327f168f3329be0bf', 'source': '0230ad0e74ea03976b28fda587bb75bdd357a1938af4424156a18265167f5e40ae', 'last_update': 1504064344}, {'active': True, 'short_id': '6990x2x1/0', 'fee_per_kw': 10, 'delay': 5, 'message_flags': 0, 'channel_flags': 0, 'destination': '02ea622d5c8d6143f15ed3ce1d501dd0d3d09d3b1c83a44d0034949f8a9ab60f06', 'source': '0230ad0e74ea03976b28fda587bb75bdd357a1938af4424156a18265167f5e40ae', 'last_update': 1504064344}, {'active': True, 'short_id': '6989x2x1/1', 'fee_per_kw': 10, 'delay': 5, 'message_flags': 0, 'channel_flags': 1, 'destination': '0230ad0e74ea03976b28fda587bb75bdd357a1938af4424156a18265167f5e40ae', 'source': '03c173897878996287a8100469f954dd820fcd8941daed91c327f168f3329be0bf', 'last_update': 1504064344}]} */ +#include "config.h" #include #include #include diff --git a/common/test/run-route.c b/common/test/run-route.c index 0db4d77d9..e1fac36eb 100644 --- a/common/test/run-route.c +++ b/common/test/run-route.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/test/run-softref.c b/common/test/run-softref.c index 1f5368caf..b5f32fc4b 100644 --- a/common/test/run-softref.c +++ b/common/test/run-softref.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/common/test/run-sphinx-xor_cipher_stream.c b/common/test/run-sphinx-xor_cipher_stream.c index a742cc5ab..963e4bda1 100644 --- a/common/test/run-sphinx-xor_cipher_stream.c +++ b/common/test/run-sphinx-xor_cipher_stream.c @@ -1,3 +1,4 @@ +#include "config.h" #include "../sphinx.c" #include #include diff --git a/common/test/run-sphinx.c b/common/test/run-sphinx.c index 4b842f626..0145682d8 100644 --- a/common/test/run-sphinx.c +++ b/common/test/run-sphinx.c @@ -1,3 +1,4 @@ +#include "config.h" #include "../hmac.c" #include "../onion.c" #include "../onionreply.c" diff --git a/common/test/run-wireaddr.c b/common/test/run-wireaddr.c index c6e19d8b7..42973fee8 100644 --- a/common/test/run-wireaddr.c +++ b/common/test/run-wireaddr.c @@ -1,3 +1,4 @@ +#include "config.h" #include "../wireaddr.c" #include #include diff --git a/common/timeout.c b/common/timeout.c index ec6f2287e..a19b85ffd 100644 --- a/common/timeout.c +++ b/common/timeout.c @@ -1,4 +1,5 @@ -#include "timeout.h" +#include "config.h" +#include #include struct oneshot { diff --git a/common/utils.c b/common/utils.c index 57bc8f02e..b9fbded5b 100644 --- a/common/utils.c +++ b/common/utils.c @@ -1,9 +1,10 @@ -#include "utils.h" +#include "config.h" #include #include #include #include #include +#include #include #include diff --git a/common/version.c b/common/version.c index f96c8798c..e64bc2595 100644 --- a/common/version.c +++ b/common/version.c @@ -1,5 +1,6 @@ -#include "version.h" +#include "config.h" #include +#include #include #include diff --git a/common/wallet.c b/common/wallet.c index 9c0964f55..599463e9f 100644 --- a/common/wallet.c +++ b/common/wallet.c @@ -1,3 +1,4 @@ +#include "config.h" #include enum wallet_tx_type fromwire_wallet_tx_type(const u8 **cursor, size_t *max) diff --git a/common/wire_error.c b/common/wire_error.c index 416d50a66..189c573a8 100644 --- a/common/wire_error.c +++ b/common/wire_error.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/connectd/connectd.c b/connectd/connectd.c index 8ed57ebb0..3bebaae02 100644 --- a/connectd/connectd.c +++ b/connectd/connectd.c @@ -7,6 +7,7 @@ * up to lightningd which will fire up a specific per-peer daemon to talk to * it. */ +#include "config.h" #include #include #include diff --git a/connectd/peer_exchange_initmsg.c b/connectd/peer_exchange_initmsg.c index 3f49a66f9..9398bb75a 100644 --- a/connectd/peer_exchange_initmsg.c +++ b/connectd/peer_exchange_initmsg.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/connectd/sha1.c b/connectd/sha1.c index d9e495197..842ebed36 100644 --- a/connectd/sha1.c +++ b/connectd/sha1.c @@ -1,4 +1,5 @@ /* hex variants removed -- RR */ +#include "config.h" #include /******************************************************************************* diff --git a/connectd/tor.c b/connectd/tor.c index 4527fe3dd..95ba253ab 100644 --- a/connectd/tor.c +++ b/connectd/tor.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/devtools/bolt11-cli.c b/devtools/bolt11-cli.c index 5ee97f9bb..33c088eb0 100644 --- a/devtools/bolt11-cli.c +++ b/devtools/bolt11-cli.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/devtools/bolt12-cli.c b/devtools/bolt12-cli.c index 2e6dc0064..4191d0848 100644 --- a/devtools/bolt12-cli.c +++ b/devtools/bolt12-cli.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/devtools/clean_topo.c b/devtools/clean_topo.c index 07f05d432..532282221 100644 --- a/devtools/clean_topo.c +++ b/devtools/clean_topo.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include diff --git a/devtools/create-gossipstore.c b/devtools/create-gossipstore.c index 0feaa083b..b4f6980f0 100644 --- a/devtools/create-gossipstore.c +++ b/devtools/create-gossipstore.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/devtools/decodemsg.c b/devtools/decodemsg.c index 03c40d4df..8512b4793 100644 --- a/devtools/decodemsg.c +++ b/devtools/decodemsg.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/devtools/dump-gossipstore.c b/devtools/dump-gossipstore.c index f5a520285..a99e918be 100644 --- a/devtools/dump-gossipstore.c +++ b/devtools/dump-gossipstore.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/devtools/gossipwith.c b/devtools/gossipwith.c index f356f0008..0e2093e67 100644 --- a/devtools/gossipwith.c +++ b/devtools/gossipwith.c @@ -1,4 +1,5 @@ /* Simple tool to route gossip from a peer. */ +#include "config.h" #include #include #include diff --git a/devtools/lightning-checkmessage.c b/devtools/lightning-checkmessage.c index bd82bc552..490111097 100644 --- a/devtools/lightning-checkmessage.c +++ b/devtools/lightning-checkmessage.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/devtools/mkclose.c b/devtools/mkclose.c index eb2ada40d..f60b6175f 100644 --- a/devtools/mkclose.c +++ b/devtools/mkclose.c @@ -4,6 +4,7 @@ * * lightning/devtools/mkclose 189c40b0728f382fe91c87270926584e48e0af3a6789f37454afee6c7560311d 0 0.00999877btc 253 0.00999877btc 0000000000000000000000000000000000000000000000000000000000000010 0000000000000000000000000000000000000000000000000000000000000020 026957e53b46df017bd6460681d068e1d23a7b027de398272d0b15f59b78d060a9 03a9f795ff2e4c27091f40e8f8277301824d1c3dfa6b0204aa92347314e41b1033 */ +#include "config.h" #include #include #include diff --git a/devtools/mkcommit.c b/devtools/mkcommit.c index f6afbf32d..288cae118 100644 --- a/devtools/mkcommit.c +++ b/devtools/mkcommit.c @@ -8,6 +8,7 @@ 0000000000000000000000000000000000000000000000000000000000000020 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000021 0000000000000000000000000000000000000000000000000000000000000022 0000000000000000000000000000000000000000000000000000000000000023 0000000000000000000000000000000000000000000000000000000000000024 \ 0000000000000000000000000000000000000000000000000000000000000010 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 0000000000000000000000000000000000000000000000000000000000000011 0000000000000000000000000000000000000000000000000000000000000012 0000000000000000000000000000000000000000000000000000000000000013 0000000000000000000000000000000000000000000000000000000000000014 */ +#include "config.h" #include #include #include diff --git a/devtools/mkencoded.c b/devtools/mkencoded.c index f53fc8677..f76d2ab81 100644 --- a/devtools/mkencoded.c +++ b/devtools/mkencoded.c @@ -1,4 +1,5 @@ /* Simple wrapper to create zlib or raw encodings of hex. */ +#include "config.h" #include #include #include diff --git a/devtools/mkfunding.c b/devtools/mkfunding.c index 0eba19538..878212de0 100644 --- a/devtools/mkfunding.c +++ b/devtools/mkfunding.c @@ -6,6 +6,7 @@ * * lightning/devtools/mkfunding 16835ac8c154b616baac524163f41fb0c4f82c7b972ad35d4d6f18d854f6856b 3 0.03btc 253 16c5027616e940d1e72b4c172557b3b799a93c0582f924441174ea556aadd01c 0000000000000000000000000000000000000000000000000000000000000050 0000000000000000000000000000000000000000000000000000000000000060 */ +#include "config.h" #include #include #include diff --git a/devtools/print_wire.c b/devtools/print_wire.c index f9e591f38..08bfc7cdb 100644 --- a/devtools/print_wire.c +++ b/devtools/print_wire.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/devtools/print_wire.h b/devtools/print_wire.h index 9fb969652..5f9f2aff3 100644 --- a/devtools/print_wire.h +++ b/devtools/print_wire.h @@ -1,5 +1,6 @@ #ifndef LIGHTNING_DEVTOOLS_PRINT_WIRE_H #define LIGHTNING_DEVTOOLS_PRINT_WIRE_H +#include "config.h" #include #include #include diff --git a/devtools/route.c b/devtools/route.c index 3fab83f8d..68c1633d7 100644 --- a/devtools/route.c +++ b/devtools/route.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/gossipd/gossip_generation.c b/gossipd/gossip_generation.c index 4ca12da62..7e71e5b81 100644 --- a/gossipd/gossip_generation.c +++ b/gossipd/gossip_generation.c @@ -1,5 +1,6 @@ /* Routines to make our own gossip messages. Not as in "we're the gossip * generation, man!" */ +#include "config.h" #include #include #include diff --git a/gossipd/gossip_store.c b/gossipd/gossip_store.c index b5ac792a3..408e79adf 100644 --- a/gossipd/gossip_store.c +++ b/gossipd/gossip_store.c @@ -1,5 +1,4 @@ -#include "gossip_store.h" - +#include "config.h" #include #include #include @@ -10,6 +9,7 @@ #include #include #include +#include #include #include #include diff --git a/gossipd/gossipd.c b/gossipd/gossipd.c index 5491ac0a1..6b1c7a4ab 100644 --- a/gossipd/gossipd.c +++ b/gossipd/gossipd.c @@ -10,6 +10,7 @@ * The gossip protocol itself is fairly simple, but has some twists which * add complexity to this daemon. */ +#include "config.h" #include #include #include diff --git a/gossipd/queries.c b/gossipd/queries.c index 2da843891..b46a683b9 100644 --- a/gossipd/queries.c +++ b/gossipd/queries.c @@ -1,4 +1,5 @@ /* Routines to generate and handle gossip query messages */ +#include "config.h" #include #include #include diff --git a/gossipd/routing.c b/gossipd/routing.c index f6cab15c1..d246b2ee5 100644 --- a/gossipd/routing.c +++ b/gossipd/routing.c @@ -1,4 +1,4 @@ -#include "routing.h" +#include "config.h" #include #include #include @@ -13,6 +13,7 @@ #include #include #include +#include #ifndef SUPERVERBOSE #define SUPERVERBOSE(...) diff --git a/gossipd/seeker.c b/gossipd/seeker.c index 476d0a012..fbff2dd1a 100644 --- a/gossipd/seeker.c +++ b/gossipd/seeker.c @@ -1,4 +1,5 @@ /* This contains the code which actively seeks out gossip from peers */ +#include "config.h" #include #include #include diff --git a/gossipd/test/run-check_channel_announcement.c b/gossipd/test/run-check_channel_announcement.c index 10cdd2e1e..28b29a341 100644 --- a/gossipd/test/run-check_channel_announcement.c +++ b/gossipd/test/run-check_channel_announcement.c @@ -27,6 +27,7 @@ bitcoin_key_2=02b3e55c7a1a6cdf17a83a801f7f8f698e4980323e2584f27a643a1b0519ebf8c7 In particular, we set feature bit 19. The spec says we should set feature bit 18 (which is clearly wrong!). */ +#include "config.h" #include "../common/wire_error.c" #include "../routing.c" #include diff --git a/gossipd/test/run-check_node_announcement.c b/gossipd/test/run-check_node_announcement.c index 87ff8f188..ca982558b 100644 --- a/gossipd/test/run-check_node_announcement.c +++ b/gossipd/test/run-check_node_announcement.c @@ -1,3 +1,4 @@ +#include "config.h" #include "../gossip_generation.c" #include #include diff --git a/gossipd/test/run-crc32_of_update.c b/gossipd/test/run-crc32_of_update.c index 86483e8a2..87e6094b2 100644 --- a/gossipd/test/run-crc32_of_update.c +++ b/gossipd/test/run-crc32_of_update.c @@ -1,3 +1,4 @@ +#include "config.h" int unused_main(int argc, char *argv[]); #define main unused_main #include "../queries.c" diff --git a/gossipd/test/run-next_block_range.c b/gossipd/test/run-next_block_range.c index 0be48d45d..e298e35f9 100644 --- a/gossipd/test/run-next_block_range.c +++ b/gossipd/test/run-next_block_range.c @@ -1,3 +1,4 @@ +#include "config.h" #include "../seeker.c" #include #include diff --git a/gossipd/test/run-onion_message.c b/gossipd/test/run-onion_message.c index 5289233dc..6cfa824e8 100644 --- a/gossipd/test/run-onion_message.c +++ b/gossipd/test/run-onion_message.c @@ -1,3 +1,4 @@ +#include "config.h" int unused_main(int argc, char *argv[]); #define main unused_main #include "../gossipd.c" diff --git a/gossipd/test/run-txout_failure.c b/gossipd/test/run-txout_failure.c index 29685664f..09b1ddbba 100644 --- a/gossipd/test/run-txout_failure.c +++ b/gossipd/test/run-txout_failure.c @@ -1,3 +1,4 @@ +#include "config.h" #include "../routing.c" #include "../common/timeout.c" #include diff --git a/hsmd/capabilities.h b/hsmd/capabilities.h index a95177901..e538ed35b 100644 --- a/hsmd/capabilities.h +++ b/hsmd/capabilities.h @@ -1,5 +1,6 @@ #ifndef LIGHTNING_HSMD_CAPABILITIES_H #define LIGHTNING_HSMD_CAPABILITIES_H +#include "config.h" #define HSM_CAP_ECDH 1 #define HSM_CAP_SIGN_GOSSIP 2 diff --git a/hsmd/hsmd.c b/hsmd/hsmd.c index 9e038539c..8ea2fba95 100644 --- a/hsmd/hsmd.c +++ b/hsmd/hsmd.c @@ -6,6 +6,7 @@ * which indicates what it's allowed to ask for. We're entirely driven * by request, response. */ +#include "config.h" #include #include #include diff --git a/hsmd/libhsmd.c b/hsmd/libhsmd.c index c06db8d4b..ece1f85f8 100644 --- a/hsmd/libhsmd.c +++ b/hsmd/libhsmd.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/hsmd/libhsmd.h b/hsmd/libhsmd.h index 5918fa57b..05d427cc9 100644 --- a/hsmd/libhsmd.h +++ b/hsmd/libhsmd.h @@ -1,6 +1,7 @@ #ifndef LIGHTNING_HSMD_LIBHSMD_H #define LIGHTNING_HSMD_LIBHSMD_H +#include "config.h" #include #include #include diff --git a/hsmd/libhsmd_status.c b/hsmd/libhsmd_status.c index 41ac3295a..919e01879 100644 --- a/hsmd/libhsmd_status.c +++ b/hsmd/libhsmd_status.c @@ -11,6 +11,7 @@ * primitives to link time, and here we provide simple ones that just * print to stdout, as alternatives to the status wire protocol ones. */ +#include "config.h" #include #include u8 *hsmd_status_bad_request(struct hsmd_client *client, const u8 *msg, const char *error) diff --git a/lightningd/bitcoind.c b/lightningd/bitcoind.c index ba6bf9d63..91711b62e 100644 --- a/lightningd/bitcoind.c +++ b/lightningd/bitcoind.c @@ -3,21 +3,22 @@ * by using bitcoin-cli, but the interface we use to gather Bitcoin data is * standardized and you can use another plugin as the Bitcoin backend, or * even make your own! */ -#include "bitcoin/base58.h" -#include "bitcoin/block.h" -#include "bitcoin/feerate.h" -#include "bitcoin/script.h" -#include "bitcoin/shadouble.h" -#include "bitcoind.h" -#include "lightningd.h" -#include "log.h" +#include "config.h" +#include +#include +#include +#include +#include #include #include #include #include #include +#include #include #include +#include +#include #include /* The names of the requests we can make to our Bitcoin backend. */ diff --git a/lightningd/chaintopology.c b/lightningd/chaintopology.c index e3a9899ba..c7070c70c 100644 --- a/lightningd/chaintopology.c +++ b/lightningd/chaintopology.c @@ -1,14 +1,7 @@ -#include "bitcoin/block.h" -#include "bitcoin/feerate.h" -#include "bitcoin/script.h" -#include "bitcoin/tx.h" -#include "bitcoind.h" -#include "chaintopology.h" -#include "channel.h" -#include "jsonrpc.h" -#include "lightningd.h" -#include "log.h" -#include "watch.h" +#include "config.h" +#include +#include +#include #include #include #include @@ -18,10 +11,16 @@ #include #include #include +#include +#include +#include #include #include #include #include +#include +#include +#include #include #include diff --git a/lightningd/channel.c b/lightningd/channel.c index 13b7ba8ed..4f7b3a0be 100644 --- a/lightningd/channel.c +++ b/lightningd/channel.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/lightningd/channel_control.c b/lightningd/channel_control.c index c01692220..b8d90cbcb 100644 --- a/lightningd/channel_control.c +++ b/lightningd/channel_control.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/lightningd/closing_control.c b/lightningd/closing_control.c index eef5e921c..96f600c78 100644 --- a/lightningd/closing_control.c +++ b/lightningd/closing_control.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/lightningd/coin_mvts.c b/lightningd/coin_mvts.c index 068d5b122..d371ac28e 100644 --- a/lightningd/coin_mvts.c +++ b/lightningd/coin_mvts.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/lightningd/connect_control.c b/lightningd/connect_control.c index d17d3e780..a01366d5a 100644 --- a/lightningd/connect_control.c +++ b/lightningd/connect_control.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/lightningd/datastore.c b/lightningd/datastore.c index a58a8f115..74b8a7cfc 100644 --- a/lightningd/datastore.c +++ b/lightningd/datastore.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/lightningd/dual_open_control.c b/lightningd/dual_open_control.c index 5fdf7d5b1..c546eb75e 100644 --- a/lightningd/dual_open_control.c +++ b/lightningd/dual_open_control.c @@ -2,6 +2,7 @@ * dualopend subdaemons. It manages the callbacks and database * saves and funding tx watching for a channel open */ +#include "config.h" #include #include #include diff --git a/lightningd/gossip_control.c b/lightningd/gossip_control.c index a1bd82203..d64575220 100644 --- a/lightningd/gossip_control.c +++ b/lightningd/gossip_control.c @@ -1,9 +1,4 @@ -#include "bitcoind.h" -#include "chaintopology.h" -#include "gossip_control.h" -#include "lightningd.h" -#include "peer_control.h" -#include "subd.h" +#include "config.h" #include #include #include @@ -11,9 +6,15 @@ #include #include #include +#include +#include +#include #include #include +#include #include +#include +#include static void got_txout(struct bitcoind *bitcoind, const struct bitcoin_tx_output *output, diff --git a/lightningd/gossip_msg.c b/lightningd/gossip_msg.c index 6b51248a7..20dcc5f97 100644 --- a/lightningd/gossip_msg.c +++ b/lightningd/gossip_msg.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/lightningd/hsm_control.c b/lightningd/hsm_control.c index ec28cab8c..323ebaba2 100644 --- a/lightningd/hsm_control.c +++ b/lightningd/hsm_control.c @@ -1,6 +1,4 @@ -#include "hsm_control.h" -#include "lightningd.h" -#include "subd.h" +#include "config.h" #include #include #include @@ -10,8 +8,11 @@ #include #include #include +#include #include #include +#include +#include #include #include #include diff --git a/lightningd/htlc_end.c b/lightningd/htlc_end.c index 461d77d17..a5225f119 100644 --- a/lightningd/htlc_end.c +++ b/lightningd/htlc_end.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/lightningd/htlc_set.c b/lightningd/htlc_set.c index 8db291a1e..40e5caa68 100644 --- a/lightningd/htlc_set.c +++ b/lightningd/htlc_set.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/lightningd/invoice.c b/lightningd/invoice.c index 07d176aa1..9c37ca30a 100644 --- a/lightningd/invoice.c +++ b/lightningd/invoice.c @@ -1,4 +1,4 @@ -#include "invoice.h" +#include "config.h" #include #include #include @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include diff --git a/lightningd/io_loop_with_timers.c b/lightningd/io_loop_with_timers.c index 7daa1f375..20f9b0618 100644 --- a/lightningd/io_loop_with_timers.c +++ b/lightningd/io_loop_with_timers.c @@ -1,7 +1,7 @@ -#include "io_loop_with_timers.h" - +#include "config.h" #include #include +#include #include void *io_loop_with_timers(struct lightningd *ld) diff --git a/lightningd/json.c b/lightningd/json.c index 73d1837aa..93e30f2b8 100644 --- a/lightningd/json.c +++ b/lightningd/json.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/lightningd/jsonrpc.c b/lightningd/jsonrpc.c index abaa940d1..e80d3edbc 100644 --- a/lightningd/jsonrpc.c +++ b/lightningd/jsonrpc.c @@ -13,7 +13,7 @@ * that point, the `json_connection` becomes the owner (or it's simply freed). */ /* eg: { "jsonrpc":"2.0", "method" : "dev-echo", "params" : [ "hello", "Arabella!" ], "id" : "1" } */ -#include "ccan/config.h" +#include "config.h" #include #include #include diff --git a/lightningd/lightningd.c b/lightningd/lightningd.c index 3df71745c..5a9f6c9d1 100644 --- a/lightningd/lightningd.c +++ b/lightningd/lightningd.c @@ -17,12 +17,9 @@ /*~ Notice how includes are in ASCII order: this is actually enforced by * the build system under `make check-source`. It avoids merge conflicts - * and keeps things consistent. */ -#include "gossip_control.h" -#include "hsm_control.h" -#include "lightningd.h" -#include "peer_control.h" -#include "subd.h" + * and keeps things consistent. It also make sure you include "config.h" + * before anything else. */ +#include "config.h" /*~ This is Ian Lance Taylor's libbacktrace. It turns out that it's * horrifically difficult to obtain a decent backtrace in C; the standard @@ -65,10 +62,15 @@ #include #include #include +#include +#include #include +#include #include #include +#include #include +#include #include #include #include diff --git a/lightningd/log.c b/lightningd/log.c index 84603aea1..292eba39c 100644 --- a/lightningd/log.c +++ b/lightningd/log.c @@ -1,4 +1,4 @@ -#include "log.h" +#include "config.h" #include #include #include @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include diff --git a/lightningd/log_status.c b/lightningd/log_status.c index a999f9955..314882c28 100644 --- a/lightningd/log_status.c +++ b/lightningd/log_status.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include diff --git a/lightningd/memdump.c b/lightningd/memdump.c index 0996ab83b..9503decbe 100644 --- a/lightningd/memdump.c +++ b/lightningd/memdump.c @@ -1,5 +1,5 @@ /* Only possible if we're in developer mode. */ -#include "memdump.h" +#include "config.h" #if DEVELOPER #include #include @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include diff --git a/lightningd/notification.c b/lightningd/notification.c index f8bdd2924..82612e6a2 100644 --- a/lightningd/notification.c +++ b/lightningd/notification.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/lightningd/offer.c b/lightningd/offer.c index 09734163c..e8118a493 100644 --- a/lightningd/offer.c +++ b/lightningd/offer.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/lightningd/onchain_control.c b/lightningd/onchain_control.c index c325a6c9d..da24e6c4c 100644 --- a/lightningd/onchain_control.c +++ b/lightningd/onchain_control.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/lightningd/onion_message.c b/lightningd/onion_message.c index 88034edc8..e6e51f5eb 100644 --- a/lightningd/onion_message.c +++ b/lightningd/onion_message.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/lightningd/opening_common.c b/lightningd/opening_common.c index d203aed8d..9af928d28 100644 --- a/lightningd/opening_common.c +++ b/lightningd/opening_common.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/lightningd/opening_control.c b/lightningd/opening_control.c index 4df90dc51..83f73b9a0 100644 --- a/lightningd/opening_control.c +++ b/lightningd/opening_control.c @@ -1,4 +1,5 @@ -#include "bitcoin/feerate.h" +#include "config.h" +#include #include #include #include diff --git a/lightningd/options.c b/lightningd/options.c index 9fb1eac0f..c335425c3 100644 --- a/lightningd/options.c +++ b/lightningd/options.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/lightningd/pay.c b/lightningd/pay.c index c6f414f2e..f4db4fc52 100644 --- a/lightningd/pay.c +++ b/lightningd/pay.c @@ -1,4 +1,4 @@ -#include "pay.h" +#include "config.h" #include #include #include @@ -14,6 +14,7 @@ #include #include #include +#include #include /* Routing failure object */ diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index a71bc358e..415b4d69f 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -1,6 +1,4 @@ -#include "lightningd.h" -#include "peer_control.h" -#include "subd.h" +#include "config.h" #include #include #include @@ -50,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -57,8 +56,10 @@ #include #include #include +#include #include #include +#include #include #include #include diff --git a/lightningd/peer_htlcs.c b/lightningd/peer_htlcs.c index 2820cd28a..5914deb25 100644 --- a/lightningd/peer_htlcs.c +++ b/lightningd/peer_htlcs.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/lightningd/ping.c b/lightningd/ping.c index eca50097d..e97351595 100644 --- a/lightningd/ping.c +++ b/lightningd/ping.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/lightningd/plugin.c b/lightningd/plugin.c index 62f3a8e5f..d37b6135c 100644 --- a/lightningd/plugin.c +++ b/lightningd/plugin.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/lightningd/plugin_control.c b/lightningd/plugin_control.c index 05f5e6723..9bd62d57c 100644 --- a/lightningd/plugin_control.c +++ b/lightningd/plugin_control.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/lightningd/plugin_hook.c b/lightningd/plugin_hook.c index b7411e84c..a1aa68cca 100644 --- a/lightningd/plugin_hook.c +++ b/lightningd/plugin_hook.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/lightningd/routehint.c b/lightningd/routehint.c index 4da52679a..4d4ebd6ad 100644 --- a/lightningd/routehint.c +++ b/lightningd/routehint.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/lightningd/signmessage.c b/lightningd/signmessage.c index d0d38f42c..44dfe52bf 100644 --- a/lightningd/signmessage.c +++ b/lightningd/signmessage.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/lightningd/subd.c b/lightningd/subd.c index 178928eda..ee9d0d79d 100644 --- a/lightningd/subd.c +++ b/lightningd/subd.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/lightningd/test/run-find_my_abspath.c b/lightningd/test/run-find_my_abspath.c index 02605e39a..41db06076 100644 --- a/lightningd/test/run-find_my_abspath.c +++ b/lightningd/test/run-find_my_abspath.c @@ -1,3 +1,4 @@ +#include "config.h" #define main unused_main int unused_main(int argc, char *argv[]); #include "../../common/base32.c" diff --git a/lightningd/test/run-invoice-select-inchan.c b/lightningd/test/run-invoice-select-inchan.c index 6a3e6d055..242b8b689 100644 --- a/lightningd/test/run-invoice-select-inchan.c +++ b/lightningd/test/run-invoice-select-inchan.c @@ -1,3 +1,4 @@ +#include "config.h" #include "../invoice.c" #include "../peer_control.c" #include "../routehint.c" diff --git a/lightningd/test/run-jsonrpc.c b/lightningd/test/run-jsonrpc.c index 3505dfd79..1479612d1 100644 --- a/lightningd/test/run-jsonrpc.c +++ b/lightningd/test/run-jsonrpc.c @@ -1,3 +1,4 @@ +#include "config.h" #include "../../common/json_stream.c" #include "../jsonrpc.c" #include "../json.c" diff --git a/lightningd/test/run-log-pruning.c b/lightningd/test/run-log-pruning.c index d029aac34..6bda5f337 100644 --- a/lightningd/test/run-log-pruning.c +++ b/lightningd/test/run-log-pruning.c @@ -1,3 +1,4 @@ +#include "config.h" #include "../log.c" #include diff --git a/lightningd/watch.c b/lightningd/watch.c index ca7f0acde..48b5d7d83 100644 --- a/lightningd/watch.c +++ b/lightningd/watch.c @@ -26,6 +26,7 @@ * * WE ASSUME NO MALLEABILITY! This requires segregated witness. */ +#include "config.h" #include #include #include diff --git a/onchaind/onchaind.c b/onchaind/onchaind.c index 87bce4eb9..47fa0d3d5 100644 --- a/onchaind/onchaind.c +++ b/onchaind/onchaind.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/onchaind/onchaind_wire.c b/onchaind/onchaind_wire.c index 8548b97b5..389b86572 100644 --- a/onchaind/onchaind_wire.c +++ b/onchaind/onchaind_wire.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include diff --git a/onchaind/test/run-grind_feerate-bug.c b/onchaind/test/run-grind_feerate-bug.c index 87268cbba..cdcc6bbd8 100644 --- a/onchaind/test/run-grind_feerate-bug.c +++ b/onchaind/test/run-grind_feerate-bug.c @@ -2,6 +2,7 @@ * No valid signature found for 3 htlc_timeout_txs feerate 10992-15370, last tx 0200000001a02a38c6ec5541963704a2a035b3094b18d69cc25cc7419d75e02894618329720000000000000000000191ea3000000000002200208bfadb3554f41cc06f00de0ec2e2f91e36ee45b5006a1f606146784755356ba532f10800, input 3215967sat, signature 3045022100917efdc8577e8578aef5e513fad25edbb55921466e8ffccb05ce8bb05a54ae6902205c2fded9d7bfc290920821bfc828720bc24287f3dad9a62fb4f806e2404ed0f401, cltvs 585998/585998/586034 wscripts 76a914f454b1fe5b95428d6beec58ed3131a6ea611b2fa8763ac672103f83ca95b22920e71487736a7284696dd52443fd8f7ce683153ac31d1d1db7da67c820120876475527c21026ebaa1d08757b86110e40e3f4a081803eec694e23ec75ee0bfd753589df896e752ae67a9148dbcec4a5d782dd87588801607ea7dfc8874ffee88ac6868/76a914f454b1fe5b95428d6beec58ed3131a6ea611b2fa8763ac672103f83ca95b22920e71487736a7284696dd52443fd8f7ce683153ac31d1d1db7da67c820120876475527c21026ebaa1d08757b86110e40e3f4a081803eec694e23ec75ee0bfd753589df896e752ae67a9148dbcec4a5d782dd87588801607ea7dfc8874ffee88ac6868/76a914f454b1fe5b95428d6beec58ed3131a6ea611b2fa8763ac672103f83ca95b22920e71487736a7284696dd52443fd8f7ce683153ac31d1d1db7da67c820120876475527c21026ebaa1d08757b86110e40e3f4a081803eec694e23ec75ee0bfd753589df896e752ae67a9148dbcec4a5d782dd87588801607ea7dfc8874ffee88ac6868 (version v0.7.1-57-gb3215a8)" */ +#include "config.h" #include #include #include diff --git a/onchaind/test/run-grind_feerate.c b/onchaind/test/run-grind_feerate.c index d15c6afc9..a59812b5d 100644 --- a/onchaind/test/run-grind_feerate.c +++ b/onchaind/test/run-grind_feerate.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/openingd/common.c b/openingd/common.c index f9b0b112c..a5d6ff412 100644 --- a/openingd/common.c +++ b/openingd/common.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/openingd/dualopend.c b/openingd/dualopend.c index 795fce83c..163c2bed1 100644 --- a/openingd/dualopend.c +++ b/openingd/dualopend.c @@ -11,6 +11,7 @@ * new and improved, two-party opening protocol, which allows bother peers to * contribute inputs to the transaction */ +#include "config.h" #include #include #include diff --git a/openingd/openingd.c b/openingd/openingd.c index c8d2cc0d2..1464b72ac 100644 --- a/openingd/openingd.c +++ b/openingd/openingd.c @@ -7,6 +7,7 @@ * there's nothing permanent about the channel: lightningd will only have to * commit to the database once openingd succeeds. */ +#include "config.h" #include #include #include diff --git a/plugins/autoclean.c b/plugins/autoclean.c index 3218dc65f..360848c15 100644 --- a/plugins/autoclean.c +++ b/plugins/autoclean.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/plugins/bcli.c b/plugins/bcli.c index a223f2c18..d4c1bb421 100644 --- a/plugins/bcli.c +++ b/plugins/bcli.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/plugins/fetchinvoice.c b/plugins/fetchinvoice.c index afc185f0c..91f8cc9a8 100644 --- a/plugins/fetchinvoice.c +++ b/plugins/fetchinvoice.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/plugins/funder_policy.c b/plugins/funder_policy.c index b079637e6..e28fe679c 100644 --- a/plugins/funder_policy.c +++ b/plugins/funder_policy.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/plugins/keysend.c b/plugins/keysend.c index e0a8e36f4..4c762c3db 100644 --- a/plugins/keysend.c +++ b/plugins/keysend.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/plugins/libplugin-pay.c b/plugins/libplugin-pay.c index 88ce1b199..0a3c32546 100644 --- a/plugins/libplugin-pay.c +++ b/plugins/libplugin-pay.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/plugins/libplugin.c b/plugins/libplugin.c index d24c85147..e77fecb7b 100644 --- a/plugins/libplugin.c +++ b/plugins/libplugin.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/plugins/offers.c b/plugins/offers.c index 7e6a933a1..4e64cbfb7 100644 --- a/plugins/offers.c +++ b/plugins/offers.c @@ -1,4 +1,5 @@ /* This plugin covers both sending and receiving offers */ +#include "config.h" #include #include #include diff --git a/plugins/offers_inv_hook.c b/plugins/offers_inv_hook.c index 765e2da3e..cc8731ae6 100644 --- a/plugins/offers_inv_hook.c +++ b/plugins/offers_inv_hook.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/plugins/offers_invreq_hook.c b/plugins/offers_invreq_hook.c index 4562c7d7d..0b7866603 100644 --- a/plugins/offers_invreq_hook.c +++ b/plugins/offers_invreq_hook.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/plugins/offers_offer.c b/plugins/offers_offer.c index 54c97b97b..a7bebf17d 100644 --- a/plugins/offers_offer.c +++ b/plugins/offers_offer.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/plugins/pay.c b/plugins/pay.c index cbd2c7c15..b454d7a8c 100644 --- a/plugins/pay.c +++ b/plugins/pay.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/plugins/spender/fundchannel.c b/plugins/spender/fundchannel.c index fa1e2db25..f0b2b1a4e 100644 --- a/plugins/spender/fundchannel.c +++ b/plugins/spender/fundchannel.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/plugins/spender/main.c b/plugins/spender/main.c index 717613319..23698567a 100644 --- a/plugins/spender/main.c +++ b/plugins/spender/main.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/plugins/spender/multiwithdraw.c b/plugins/spender/multiwithdraw.c index 941c84d6a..afe7a3534 100644 --- a/plugins/spender/multiwithdraw.c +++ b/plugins/spender/multiwithdraw.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/plugins/test/run-funder_policy.c b/plugins/test/run-funder_policy.c index eecaa89e4..8efb543e5 100644 --- a/plugins/test/run-funder_policy.c +++ b/plugins/test/run-funder_policy.c @@ -1,3 +1,4 @@ +#include "config.h" #include "../funder_policy.c" #include #include diff --git a/plugins/test/run-route-overlong.c b/plugins/test/run-route-overlong.c index ce67a15a9..3999a31cf 100644 --- a/plugins/test/run-route-overlong.c +++ b/plugins/test/run-route-overlong.c @@ -1,3 +1,4 @@ +#include "config.h" #include "../libplugin-pay.c" #include #include diff --git a/plugins/topology.c b/plugins/topology.c index cfc3bd8ea..9c5444222 100644 --- a/plugins/topology.c +++ b/plugins/topology.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/plugins/txprepare.c b/plugins/txprepare.c index dcb514a49..82776adc0 100644 --- a/plugins/txprepare.c +++ b/plugins/txprepare.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/tests/fuzz/fuzz-addr.c b/tests/fuzz/fuzz-addr.c index 57c54ac47..96379da48 100644 --- a/tests/fuzz/fuzz-addr.c +++ b/tests/fuzz/fuzz-addr.c @@ -1,3 +1,4 @@ +#include "config.h" #include "common/utils.h" #include diff --git a/tests/fuzz/fuzz-descriptor_checksum.c b/tests/fuzz/fuzz-descriptor_checksum.c index 7b37efc83..a9a8dd6f5 100644 --- a/tests/fuzz/fuzz-descriptor_checksum.c +++ b/tests/fuzz/fuzz-descriptor_checksum.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include diff --git a/tests/fuzz/libfuzz.c b/tests/fuzz/libfuzz.c index 91aceddd3..8612846e3 100644 --- a/tests/fuzz/libfuzz.c +++ b/tests/fuzz/libfuzz.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include diff --git a/tests/fuzz/libfuzz.h b/tests/fuzz/libfuzz.h index 3d28f74d3..3884a33fc 100644 --- a/tests/fuzz/libfuzz.h +++ b/tests/fuzz/libfuzz.h @@ -1,6 +1,7 @@ #ifndef LIGHTNING_TESTS_FUZZ_LIBFUZZ_H #define LIGHTNING_TESTS_FUZZ_LIBFUZZ_H +#include "config.h" #include #include #include diff --git a/tests/plugins/test_libplugin.c b/tests/plugins/test_libplugin.c index 49440be82..bb786a1b8 100644 --- a/tests/plugins/test_libplugin.c +++ b/tests/plugins/test_libplugin.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/tests/plugins/test_selfdisable_after_getmanifest.c b/tests/plugins/test_selfdisable_after_getmanifest.c index 69c07c3e1..443aae09b 100644 --- a/tests/plugins/test_selfdisable_after_getmanifest.c +++ b/tests/plugins/test_selfdisable_after_getmanifest.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/tools/check-bolt.c b/tools/check-bolt.c index c915fb174..2149caf89 100644 --- a/tools/check-bolt.c +++ b/tools/check-bolt.c @@ -1,5 +1,6 @@ /* Simple program to search for BOLT references in C files and make sure * they're accurate. */ +#include "config.h" #include #include #include diff --git a/tools/check-includes.sh b/tools/check-includes.sh index e75c20b75..74d0e1b2c 100755 --- a/tools/check-includes.sh +++ b/tools/check-includes.sh @@ -20,6 +20,11 @@ do echo EXIT_CODE=1 fi + # Ignore contrib/. + if [ "${HEADER_FILE##contrib/}" = "$HEADER_FILE" -a "$(grep '#include' $HEADER_FILE | head -n1)" != '#include "config.h"' ]; then + echo "${HEADER_FILE}:1:does not include config.h first" + EXIT_CODE=1 + fi done # Check redundant includes @@ -62,6 +67,11 @@ for C_FILE in $(filter_suffix c); do echo "${C_FILE} does not include $H_FILE" >& 2 EXIT_CODE=1 fi + # Ignore contrib/. + if [ "${C_FILE##contrib/}" = "$C_FILE" -a "$(grep '#include' $C_FILE | head -n1)" != '#include "config.h"' ]; then + echo "${C_FILE}:1:does not include config.h first" + EXIT_CODE=1 + fi done exit ${EXIT_CODE} diff --git a/tools/hsmtool.c b/tools/hsmtool.c index 74e5d3408..5f5457a2e 100644 --- a/tools/hsmtool.c +++ b/tools/hsmtool.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/tools/test/enum.c b/tools/test/enum.c index df77744bc..b8ad28ee5 100644 --- a/tools/test/enum.c +++ b/tools/test/enum.c @@ -1,3 +1,4 @@ +#include "config.h" #include "enum.h" #include diff --git a/tools/test/enum.h b/tools/test/enum.h index dee45be09..702105e94 100644 --- a/tools/test/enum.h +++ b/tools/test/enum.h @@ -1,5 +1,6 @@ #ifndef LIGHTNING_TOOLS_TEST_ENUM_H #define LIGHTNING_TOOLS_TEST_ENUM_H +#include "config.h" #include #include diff --git a/tools/test/run-test-wire.c b/tools/test/run-test-wire.c index 5b8e3ec1b..28ae95df0 100644 --- a/tools/test/run-test-wire.c +++ b/tools/test/run-test-wire.c @@ -1,3 +1,4 @@ +#include "config.h" #include "test_gen.h" #include "print_gen.h" diff --git a/wallet/db.c b/wallet/db.c index e10217b6a..f0117c063 100644 --- a/wallet/db.c +++ b/wallet/db.c @@ -1,5 +1,4 @@ -#include "db.h" - +#include "config.h" #include #include #include @@ -13,6 +12,7 @@ #include #include #include +#include #include #include diff --git a/wallet/db_postgres.c b/wallet/db_postgres.c index 34f6562d8..91db5beff 100644 --- a/wallet/db_postgres.c +++ b/wallet/db_postgres.c @@ -1,8 +1,9 @@ -#include "db_postgres_sqlgen.c" +#include "config.h" #include #include #include #include +#include #if HAVE_POSTGRES /* Indented in order not to trigger the inclusion order check */ diff --git a/wallet/db_sqlite3.c b/wallet/db_sqlite3.c index 6cc324f6e..4459e6b2e 100644 --- a/wallet/db_sqlite3.c +++ b/wallet/db_sqlite3.c @@ -1,3 +1,4 @@ +#include "config.h" #include "db_sqlite3_sqlgen.c" #include #include diff --git a/wallet/invoices.c b/wallet/invoices.c index 1142dcb80..1d6e268ec 100644 --- a/wallet/invoices.c +++ b/wallet/invoices.c @@ -1,8 +1,9 @@ -#include "db.h" -#include "invoices.h" -#include "wallet.h" +#include "config.h" #include #include +#include +#include +#include struct invoice_waiter { /* Is this waiter already triggered? */ diff --git a/wallet/reservation.c b/wallet/reservation.c index 46ba907b8..eea112e18 100644 --- a/wallet/reservation.c +++ b/wallet/reservation.c @@ -1,4 +1,5 @@ /* Dealing with reserving UTXOs */ +#include "config.h" #include #include #include diff --git a/wallet/test/run-db.c b/wallet/test/run-db.c index 9f7e17d6a..176661324 100644 --- a/wallet/test/run-db.c +++ b/wallet/test/run-db.c @@ -1,3 +1,4 @@ +#include "config.h" #include static void db_test_fatal(const char *fmt, ...); diff --git a/wallet/test/run-wallet.c b/wallet/test/run-wallet.c index 43425ab05..213b54c44 100644 --- a/wallet/test/run-wallet.c +++ b/wallet/test/run-wallet.c @@ -1,3 +1,4 @@ +#include "config.h" #include static void wallet_test_fatal(const char *fmt, ...); diff --git a/wallet/test/test_utils.c b/wallet/test/test_utils.c index ef1fd8b0b..69c514d40 100644 --- a/wallet/test/test_utils.c +++ b/wallet/test/test_utils.c @@ -1,3 +1,4 @@ +#include "config.h" #include "test_utils.h" /* diff --git a/wallet/test/test_utils.h b/wallet/test/test_utils.h index 8500b60bc..fa322f8e1 100644 --- a/wallet/test/test_utils.h +++ b/wallet/test/test_utils.h @@ -1,6 +1,7 @@ #ifndef LIGHTNING_WALLET_TEST_TEST_UTILS_H #define LIGHTNING_WALLET_TEST_TEST_UTILS_H +#include "config.h" #include "lightningd/lightningd.h" /* Definitions "inspired" by libsecp256k1 */ diff --git a/wallet/txfilter.c b/wallet/txfilter.c index 1e4c47ab9..c801da7fc 100644 --- a/wallet/txfilter.c +++ b/wallet/txfilter.c @@ -1,10 +1,10 @@ -#include "txfilter.h" - +#include "config.h" #include #include #include #include #include +#include #include static size_t scriptpubkey_hash(const u8 *out) diff --git a/wallet/wallet.c b/wallet/wallet.c index 29bd385e5..e035686f4 100644 --- a/wallet/wallet.c +++ b/wallet/wallet.c @@ -1,6 +1,4 @@ -#include "invoices.h" -#include "wallet.h" - +#include "config.h" #include #include #include @@ -17,7 +15,9 @@ #include #include #include +#include #include +#include #include #define SQLITE_MAX_UINT 0x7FFFFFFFFFFFFFFF diff --git a/wallet/walletrpc.c b/wallet/walletrpc.c index 6fe87d0bb..5c1fa2e7a 100644 --- a/wallet/walletrpc.c +++ b/wallet/walletrpc.c @@ -1,3 +1,4 @@ +#include "config.h" #include #include #include diff --git a/wire/fromwire.c b/wire/fromwire.c index 4121180b9..e960f6e8e 100644 --- a/wire/fromwire.c +++ b/wire/fromwire.c @@ -1,9 +1,10 @@ -#include "wire.h" +#include "config.h" #include #include #include #include #include +#include #ifndef SUPERVERBOSE #define SUPERVERBOSE(...) diff --git a/wire/peer_wire.c b/wire/peer_wire.c index aa3f3133e..340085d28 100644 --- a/wire/peer_wire.c +++ b/wire/peer_wire.c @@ -1,3 +1,4 @@ +#include "config.h" #include static bool unknown_type(enum peer_wire t) diff --git a/wire/test/run-peer-wire.c b/wire/test/run-peer-wire.c index 91a641da4..c6b025c41 100644 --- a/wire/test/run-peer-wire.c +++ b/wire/test/run-peer-wire.c @@ -1,3 +1,4 @@ +#include "config.h" #include "../towire.c" #include "../fromwire.c" #include "../peer_wire.c" diff --git a/wire/test/run-tlvstream.c b/wire/test/run-tlvstream.c index 3c06a7e9f..9fe2959d1 100644 --- a/wire/test/run-tlvstream.c +++ b/wire/test/run-tlvstream.c @@ -1,3 +1,4 @@ +#include "config.h" #include static const char *reason; diff --git a/wire/towire.c b/wire/towire.c index d4697997e..6b104dd60 100644 --- a/wire/towire.c +++ b/wire/towire.c @@ -1,3 +1,4 @@ +#include "config.h" #include "wire.h" #include #include diff --git a/wire/wire_io.c b/wire/wire_io.c index 39af137e4..0d7054ded 100644 --- a/wire/wire_io.c +++ b/wire/wire_io.c @@ -1,3 +1,4 @@ +#include "config.h" /* FIXME: io_plan needs size_t */ #include #include