From f6a4e794207d34432e22e8bae8d7eb15aea136cc Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 22 Oct 2025 19:44:27 +1030 Subject: [PATCH] global: remove unnecessary includes from headers. Each header should only include the other headers it needs to compile; `devtools/reduce-includes.sh */*.h` does this. The C files then need additional includes if they don't compile. And remove the entirely useless wire/onion_wire.h, which only serves to include wire/onion_wiregen.h. Signed-off-by: Rusty Russell --- bitcoin/block.h | 1 - bitcoin/feerate.h | 1 - bitcoin/privkey.h | 1 - bitcoin/script.c | 1 + bitcoin/script.h | 1 - bitcoin/short_channel_id.h | 1 - bitcoin/tx.h | 4 ---- channeld/channeld.c | 2 ++ channeld/channeld.h | 1 - channeld/channeld_htlc.h | 3 --- channeld/full_channel.c | 1 + channeld/inflight.h | 1 + channeld/test/run-commit_tx.c | 1 + cli/config_cli.h | 1 - cli/lightning-cli.c | 1 + closingd/closingd_wire.csv | 1 + common/amount.h | 1 + common/autodata.h | 2 -- common/blindedpath.c | 4 +++- common/blindedpath.h | 1 - common/blindedpay.c | 1 + common/blindedpay.h | 1 - common/bolt12.c | 2 ++ common/bolt12_merkle.c | 1 + common/channel_type.c | 1 + common/codex32.c | 1 + common/coin_mvt.c | 1 + common/coin_mvt.h | 2 -- common/cryptomsg.c | 1 + common/cryptomsg.h | 1 - common/decode_array.c | 1 + common/dijkstra.c | 1 + common/ecdh_hsmd.c | 2 ++ common/ecdh_hsmd.h | 1 - common/errcode.h | 1 - common/features.c | 1 + common/gossip_constants.h | 1 - common/gossmap.c | 1 + common/gossmap.h | 3 --- common/gossmods_listpeerchannels.h | 1 - common/hsm_capable.c | 1 + common/hsm_capable.h | 1 - common/hsm_encryption.c | 1 + common/hsm_encryption.h | 2 -- common/htlc.h | 1 - common/htlc_tx.h | 1 - common/htlc_wire.c | 1 + common/initial_commit_tx.h | 1 - common/interactivetx.c | 2 ++ common/interactivetx.h | 4 ---- common/json_blinded_path.c | 4 +++- common/json_command.h | 2 -- common/json_filter.h | 2 -- common/json_param.c | 1 + common/json_param.h | 3 --- common/json_parse.c | 1 - common/json_parse.h | 2 -- common/json_parse_simple.c | 1 - common/json_stream.h | 2 -- common/jsonrpc_errors.h | 1 - common/key_derive.h | 1 - common/lease_rates.c | 1 + common/lease_rates.h | 1 - common/memleak.h | 2 -- common/node_id.h | 1 - common/onion_decode.c | 1 + common/onion_decode.h | 2 -- common/onion_encode.c | 1 + common/onion_message.c | 2 +- common/onion_message.h | 1 - common/onion_message_parse.c | 2 +- common/onion_message_parse.h | 1 - common/peer_failed.c | 1 + common/per_peer_state.h | 2 -- common/psbt_internal.c | 1 + common/psbt_open.h | 1 - common/pseudorand.c | 1 - common/pseudorand.h | 1 + common/read_peer_msg.c | 1 + common/scb_wire.csv | 1 + common/shutdown_scriptpubkey.c | 1 + common/sphinx.c | 2 +- common/sphinx.h | 2 +- common/splice_script.h | 1 - common/status.c | 1 + common/test/run-bolt12-format-string-test.c | 1 + common/test/run-bolt12_merkle-json.c | 1 + common/test/run-cryptomsg.c | 1 + common/test/run-json.c | 1 + common/trace.c | 1 + common/utils.h | 1 - common/wire_error.c | 1 + connectd/connectd.c | 3 +++ connectd/connectd.h | 4 ---- connectd/connectd_gossipd_wire.csv | 2 -- connectd/connectd_wire.csv | 4 +--- connectd/gossip_store.c | 1 + connectd/multiplex.c | 1 + connectd/onion_message.c | 1 + connectd/peer_exchange_initmsg.c | 2 ++ connectd/queries.c | 1 + db/common.h | 3 --- db/utils.c | 1 + devtools/bolt11-cli.c | 1 + devtools/bolt12-cli.c | 1 + devtools/checkchannels.c | 1 + devtools/convert-gossmap.c | 1 + devtools/create-gossipstore.c | 1 + devtools/decodemsg.c | 1 + devtools/dump-gossipstore.c | 1 + devtools/gossipwith.c | 1 + devtools/gossmap-compress.c | 1 + devtools/mkcommit.c | 1 + devtools/mkencoded.c | 1 + devtools/mkgossip.c | 2 ++ devtools/mkquery.c | 1 + devtools/onion.c | 1 + devtools/print_wire.c | 5 +++++ devtools/print_wire.h | 6 +----- devtools/route.c | 1 + devtools/topology.c | 1 + gossipd/gossip_store.c | 1 + gossipd/gossip_store.h | 3 --- gossipd/gossipd.c | 1 + gossipd/gossipd.h | 1 + gossipd/gossipd_wire.csv | 2 +- gossipd/gossmap_manage.c | 1 + gossipd/queries.c | 1 + gossipd/seeker.c | 1 + hsmd/hsm_utxo.h | 2 -- hsmd/hsmd.c | 1 + hsmd/hsmd_wire.csv | 1 + hsmd/libhsmd.c | 1 + hsmd/libhsmd.h | 1 - lightningd/bitcoind.h | 1 - lightningd/chaintopology.c | 1 + lightningd/chaintopology.h | 3 --- lightningd/channel.h | 1 + lightningd/channel_control.c | 1 + lightningd/channel_state.h | 1 - lightningd/closing_control.c | 1 + lightningd/connect_control.c | 1 + lightningd/dual_open_control.c | 1 + lightningd/forwards.h | 3 ++- lightningd/gossip_control.c | 1 + lightningd/gossip_control.h | 2 -- lightningd/htlc_end.c | 1 + lightningd/htlc_set.h | 1 - lightningd/invoice.h | 1 - lightningd/lightningd.c | 2 ++ lightningd/opening_common.h | 2 -- lightningd/opening_control.c | 1 + lightningd/options.c | 2 ++ lightningd/peer_control.c | 1 - lightningd/peer_fd.h | 1 - lightningd/runes.c | 1 + lightningd/subd.c | 1 + lightningd/subd.h | 5 ----- onchaind/onchaind.c | 1 + onchaind/onchaind_wire.csv | 1 + openingd/common.h | 1 + openingd/dualopend.c | 2 ++ openingd/dualopend_wire.csv | 1 + openingd/openingd_wire.csv | 1 + plugins/askrene/askrene.c | 1 + plugins/askrene/mcf.c | 1 + plugins/askrene/reserve.c | 1 + plugins/autoclean.c | 1 + plugins/bcli.c | 1 + plugins/bkpr/bookkeeper.c | 1 + plugins/bkpr/rebalances.c | 1 + plugins/chanbackup.c | 1 + plugins/channel_hint.c | 1 + plugins/channel_hint.h | 5 ----- plugins/commando.c | 1 + plugins/establish_onion_path.c | 1 + plugins/establish_onion_path.h | 1 - plugins/fetchinvoice.c | 2 ++ plugins/funder.c | 1 + plugins/keysend.c | 3 +++ plugins/libplugin-pay.c | 5 +++++ plugins/libplugin-pay.h | 5 +---- plugins/libplugin.c | 3 +++ plugins/libplugin.h | 10 ---------- plugins/offers.c | 2 ++ plugins/offers_inv_hook.c | 1 + plugins/offers_invreq_hook.c | 2 ++ plugins/offers_offer.c | 1 + plugins/pay.c | 1 + plugins/renepay/disabledmap.c | 1 + plugins/renepay/main.c | 1 + plugins/spender/multifundchannel.c | 1 + plugins/spender/multiwithdraw.c | 1 + plugins/spender/openchannel.c | 1 + plugins/spender/splice.c | 1 + plugins/topology.c | 1 + plugins/xpay/xpay.c | 2 ++ tests/fuzz/fuzz-bolt12-invrequest-decode.c | 1 + tests/fuzz/libfuzz.h | 1 + tests/plugins/channeld_fakenet.c | 1 + tools/hsmtool.c | 1 + wallet/reservation.c | 1 + wallet/test/run-wallet.c | 1 + wallet/txfilter.c | 1 + wallet/wallet.h | 1 + wire/Makefile | 6 ++++-- wire/onion_defs.h | 1 - wire/onion_wire.h | 8 -------- wire/peer_wire.h | 1 - wire/tlvstream.c | 1 + wire/tlvstream.h | 2 -- wire/wire.h | 3 --- 212 files changed, 178 insertions(+), 153 deletions(-) delete mode 100644 wire/onion_wire.h diff --git a/bitcoin/block.h b/bitcoin/block.h index a2631b732f..a3289ee7cc 100644 --- a/bitcoin/block.h +++ b/bitcoin/block.h @@ -4,7 +4,6 @@ #include "bitcoin/shadouble.h" #include #include -#include struct chainparams; diff --git a/bitcoin/feerate.h b/bitcoin/feerate.h index cab1e95e25..f4dbdbbd67 100644 --- a/bitcoin/feerate.h +++ b/bitcoin/feerate.h @@ -2,7 +2,6 @@ #define LIGHTNING_BITCOIN_FEERATE_H #include "config.h" #include -#include #include /* bitcoind considers 250 satoshi per kw to be the minimum acceptable fee: diff --git a/bitcoin/privkey.h b/bitcoin/privkey.h index d592d46855..b4ee358415 100644 --- a/bitcoin/privkey.h +++ b/bitcoin/privkey.h @@ -2,7 +2,6 @@ #define LIGHTNING_BITCOIN_PRIVKEY_H #include "config.h" #include -#include #include #define PRIVKEY_LEN 32 diff --git a/bitcoin/script.c b/bitcoin/script.c index 63974644a3..71e0dd0757 100644 --- a/bitcoin/script.c +++ b/bitcoin/script.c @@ -9,6 +9,7 @@ #include #include #include +#include /* To push 0-75 bytes onto stack. */ #define OP_PUSHBYTES(val) (val) diff --git a/bitcoin/script.h b/bitcoin/script.h index 5b96d696ff..ccbad3bfe2 100644 --- a/bitcoin/script.h +++ b/bitcoin/script.h @@ -3,7 +3,6 @@ #include "config.h" #include "signature.h" #include "tx.h" -#include struct bitcoin_address; struct preimage; diff --git a/bitcoin/short_channel_id.h b/bitcoin/short_channel_id.h index 1cd13f9a4c..3c7cce9036 100644 --- a/bitcoin/short_channel_id.h +++ b/bitcoin/short_channel_id.h @@ -1,7 +1,6 @@ #ifndef LIGHTNING_BITCOIN_SHORT_CHANNEL_ID_H #define LIGHTNING_BITCOIN_SHORT_CHANNEL_ID_H #include "config.h" -#include #include #include #include diff --git a/bitcoin/tx.h b/bitcoin/tx.h index 2549cd5e2b..4b7134e0f8 100644 --- a/bitcoin/tx.h +++ b/bitcoin/tx.h @@ -2,11 +2,7 @@ #define LIGHTNING_BITCOIN_TX_H #include "config.h" #include -#include -#include #include -#include -#include #include #define BITCOIN_TX_DEFAULT_SEQUENCE 0xFFFFFFFF diff --git a/channeld/channeld.c b/channeld/channeld.c index eb1b7a5031..dc8bdf24bb 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -42,10 +42,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include diff --git a/channeld/channeld.h b/channeld/channeld.h index a2b26b0824..c57a2902e0 100644 --- a/channeld/channeld.h +++ b/channeld/channeld.h @@ -2,7 +2,6 @@ #define LIGHTNING_CHANNELD_CHANNELD_H #include "config.h" #include -#include #include const u8 *hsm_req(const tal_t *ctx, const u8 *req TAKES); diff --git a/channeld/channeld_htlc.h b/channeld/channeld_htlc.h index 14d41f07ab..2bd7075c25 100644 --- a/channeld/channeld_htlc.h +++ b/channeld/channeld_htlc.h @@ -1,11 +1,8 @@ #ifndef LIGHTNING_CHANNELD_CHANNELD_HTLC_H #define LIGHTNING_CHANNELD_CHANNELD_HTLC_H #include "config.h" -#include #include #include -#include -#include struct htlc { /* What's the status. */ diff --git a/channeld/full_channel.c b/channeld/full_channel.c index 699ccdf40c..9bf383dbc8 100644 --- a/channeld/full_channel.c +++ b/channeld/full_channel.c @@ -13,6 +13,7 @@ #include #include #include +#include #include /* Needs to be at end, since it doesn't include its own hdrs */ #include "full_channel_error_names_gen.h" diff --git a/channeld/inflight.h b/channeld/inflight.h index 7143e0ad9a..025dc45024 100644 --- a/channeld/inflight.h +++ b/channeld/inflight.h @@ -3,6 +3,7 @@ #include "config.h" #include +#include #include #include diff --git a/channeld/test/run-commit_tx.c b/channeld/test/run-commit_tx.c index f2e0c8df07..b57e50a36c 100644 --- a/channeld/test/run-commit_tx.c +++ b/channeld/test/run-commit_tx.c @@ -9,6 +9,7 @@ static bool print_superverbose; #define PRINT_ACTUAL_FEE #include "../commit_tx.c" #include +#include #include #include #include diff --git a/cli/config_cli.h b/cli/config_cli.h index 6faeb36069..5b0dcfd6cd 100644 --- a/cli/config_cli.h +++ b/cli/config_cli.h @@ -2,7 +2,6 @@ #define LIGHTNING_CLI_CONFIG_CLI_H #include "config.h" -#include #ifndef CLN_TEST /* Redefinition procedure is a very cool feature, but diff --git a/cli/lightning-cli.c b/cli/lightning-cli.c index 10f8fffc2d..8ebc254092 100644 --- a/cli/lightning-cli.c +++ b/cli/lightning-cli.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include diff --git a/closingd/closingd_wire.csv b/closingd/closingd_wire.csv index 10a5d8cbb1..55ca558979 100644 --- a/closingd/closingd_wire.csv +++ b/closingd/closingd_wire.csv @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/common/amount.h b/common/amount.h index b1cdbac1d5..11551b913a 100644 --- a/common/amount.h +++ b/common/amount.h @@ -1,6 +1,7 @@ #ifndef LIGHTNING_COMMON_AMOUNT_H #define LIGHTNING_COMMON_AMOUNT_H #include "config.h" +#include #include #include diff --git a/common/autodata.h b/common/autodata.h index 60c300bab9..6a18ffc251 100644 --- a/common/autodata.h +++ b/common/autodata.h @@ -1,8 +1,6 @@ #ifndef LIGHTNING_COMMON_AUTODATA_H #define LIGHTNING_COMMON_AUTODATA_H #include "config.h" -#include -#include #include #define AUTODATA_TYPE(name, type) \ diff --git a/common/blindedpath.c b/common/blindedpath.c index c13b49d9fc..0923c40b3c 100644 --- a/common/blindedpath.c +++ b/common/blindedpath.c @@ -1,13 +1,15 @@ #include "config.h" +#include #include #include #include #include #include #include +#include #include #include -#include +#include #ifndef SUPERVERBOSE #define SUPERVERBOSE(...) diff --git a/common/blindedpath.h b/common/blindedpath.h index b848693510..7a5238f153 100644 --- a/common/blindedpath.h +++ b/common/blindedpath.h @@ -1,7 +1,6 @@ #ifndef LIGHTNING_COMMON_BLINDEDPATH_H #define LIGHTNING_COMMON_BLINDEDPATH_H #include "config.h" -#include #include #include diff --git a/common/blindedpay.c b/common/blindedpay.c index 9c3dec2e72..1dc6f744a7 100644 --- a/common/blindedpay.c +++ b/common/blindedpay.c @@ -3,6 +3,7 @@ #include #include #include +#include u8 **blinded_onion_hops(const tal_t *ctx, struct amount_msat final_amount, diff --git a/common/blindedpay.h b/common/blindedpay.h index fa99483aa8..b455e38a1f 100644 --- a/common/blindedpay.h +++ b/common/blindedpay.h @@ -2,7 +2,6 @@ #ifndef LIGHTNING_COMMON_BLINDEDPAY_H #define LIGHTNING_COMMON_BLINDEDPAY_H #include "config.h" -#include #include struct blinded_path; diff --git a/common/bolt12.c b/common/bolt12.c index f3bcbcdc1b..8716807a92 100644 --- a/common/bolt12.c +++ b/common/bolt12.c @@ -9,9 +9,11 @@ #include #include #include +#include #include #include #include +#include /* If chains is NULL, max_num_chains is ignored */ bool bolt12_chains_match(const struct bitcoin_blkid *chains, diff --git a/common/bolt12_merkle.c b/common/bolt12_merkle.c index 6ca21896a2..7f4e18580d 100644 --- a/common/bolt12_merkle.c +++ b/common/bolt12_merkle.c @@ -5,6 +5,7 @@ #include #include #include +#include #ifndef SUPERVERBOSE #define SUPERVERBOSE(...) diff --git a/common/channel_type.c b/common/channel_type.c index 61302b45c2..bae0d6b984 100644 --- a/common/channel_type.c +++ b/common/channel_type.c @@ -1,6 +1,7 @@ #include "config.h" #include #include +#include static struct channel_type *new_channel_type(const tal_t *ctx) { diff --git a/common/codex32.c b/common/codex32.c index f74587a634..6ccb0c4950 100644 --- a/common/codex32.c +++ b/common/codex32.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include diff --git a/common/coin_mvt.c b/common/coin_mvt.c index 4e9ec871e0..e797758e69 100644 --- a/common/coin_mvt.c +++ b/common/coin_mvt.c @@ -6,6 +6,7 @@ #include #include #include +#include #include static const char *mvt_tags[] = { diff --git a/common/coin_mvt.h b/common/coin_mvt.h index e9a41b3251..822e6e821b 100644 --- a/common/coin_mvt.h +++ b/common/coin_mvt.h @@ -3,9 +3,7 @@ #include "config.h" #include -#include #include -#include #define COIN_MVT_VERSION 2 #define ACCOUNT_NAME_WALLET "wallet" diff --git a/common/cryptomsg.c b/common/cryptomsg.c index f9ede9955d..4225fefa8f 100644 --- a/common/cryptomsg.c +++ b/common/cryptomsg.c @@ -1,5 +1,6 @@ #include "config.h" #include +#include #include #include #include diff --git a/common/cryptomsg.h b/common/cryptomsg.h index 3da33879c4..d7c5634d05 100644 --- a/common/cryptomsg.h +++ b/common/cryptomsg.h @@ -1,7 +1,6 @@ #ifndef LIGHTNING_COMMON_CRYPTOMSG_H #define LIGHTNING_COMMON_CRYPTOMSG_H #include "config.h" -#include #include /* BOLT #8: diff --git a/common/decode_array.c b/common/decode_array.c index 0f9a8310b5..83c7d7703b 100644 --- a/common/decode_array.c +++ b/common/decode_array.c @@ -1,6 +1,7 @@ #include "config.h" #include #include +#include #include struct short_channel_id *decode_short_ids(const tal_t *ctx, const u8 *encoded) diff --git a/common/dijkstra.c b/common/dijkstra.c index afdc4d7be7..d29173b61d 100644 --- a/common/dijkstra.c +++ b/common/dijkstra.c @@ -7,6 +7,7 @@ #include #include #include +#include #include /* Each node has this side-info. */ diff --git a/common/ecdh_hsmd.c b/common/ecdh_hsmd.c index b8546ea990..5e186d51b0 100644 --- a/common/ecdh_hsmd.c +++ b/common/ecdh_hsmd.c @@ -1,5 +1,7 @@ #include "config.h" +#include #include +#include #include #include diff --git a/common/ecdh_hsmd.h b/common/ecdh_hsmd.h index ca9288fbf3..7c8aad5b2c 100644 --- a/common/ecdh_hsmd.h +++ b/common/ecdh_hsmd.h @@ -1,7 +1,6 @@ #ifndef LIGHTNING_COMMON_ECDH_HSMD_H #define LIGHTNING_COMMON_ECDH_HSMD_H #include "config.h" -#include #include /* The via-the-hsmd implementation of ecdh(). */ diff --git a/common/errcode.h b/common/errcode.h index 9fcf6fbedc..dc3560be5d 100644 --- a/common/errcode.h +++ b/common/errcode.h @@ -3,7 +3,6 @@ #include "config.h" -#include // Setup errors #define EXITCODE_SUBDAEMON_FAIL 10 diff --git a/common/features.c b/common/features.c index 030068eb7c..7573fea58e 100644 --- a/common/features.c +++ b/common/features.c @@ -3,6 +3,7 @@ #include #include #include +#include #include enum feature_copy_style { diff --git a/common/gossip_constants.h b/common/gossip_constants.h index 53ed1cc842..d5a7623129 100644 --- a/common/gossip_constants.h +++ b/common/gossip_constants.h @@ -1,7 +1,6 @@ #ifndef LIGHTNING_COMMON_GOSSIP_CONSTANTS_H #define LIGHTNING_COMMON_GOSSIP_CONSTANTS_H #include "config.h" -#include /* FIXME: This is a legacy concept, which should be eliminated now we have * only onion tlv payloads. */ diff --git a/common/gossmap.c b/common/gossmap.c index 1f3c5c017d..a21a666f91 100644 --- a/common/gossmap.c +++ b/common/gossmap.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include diff --git a/common/gossmap.h b/common/gossmap.h index ef3b71a6dc..1b60a1fdcc 100644 --- a/common/gossmap.h +++ b/common/gossmap.h @@ -2,9 +2,6 @@ #define LIGHTNING_COMMON_GOSSMAP_H #include "config.h" #include -#include -#include -#include #include #include diff --git a/common/gossmods_listpeerchannels.h b/common/gossmods_listpeerchannels.h index f97694d689..8a62e77d14 100644 --- a/common/gossmods_listpeerchannels.h +++ b/common/gossmods_listpeerchannels.h @@ -2,7 +2,6 @@ #define LIGHTNING_COMMON_GOSSMODS_LISTPEERCHANNELS_H #include "config.h" #include -#include #include #include diff --git a/common/hsm_capable.c b/common/hsm_capable.c index a8187681cf..5194ea1a21 100644 --- a/common/hsm_capable.c +++ b/common/hsm_capable.c @@ -1,4 +1,5 @@ #include "config.h" +#include #include /* Is this capability supported by the HSM? (So far, always a message diff --git a/common/hsm_capable.h b/common/hsm_capable.h index 82c9f00f11..d6d6ddb358 100644 --- a/common/hsm_capable.h +++ b/common/hsm_capable.h @@ -2,7 +2,6 @@ #define LIGHTNING_COMMON_HSM_CAPABLE_H #include "config.h" #include -#include #include /* Is this capability supported by the HSM? (So far, always a message diff --git a/common/hsm_encryption.c b/common/hsm_encryption.c index 33fc617f7a..c8f316a316 100644 --- a/common/hsm_encryption.c +++ b/common/hsm_encryption.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include diff --git a/common/hsm_encryption.h b/common/hsm_encryption.h index 0f1b36097d..af67701ade 100644 --- a/common/hsm_encryption.h +++ b/common/hsm_encryption.h @@ -2,9 +2,7 @@ #define LIGHTNING_COMMON_HSM_ENCRYPTION_H #include "config.h" #include -#include #include -#include /* Length of the encrypted hsm secret header. */ #define HS_HEADER_LEN crypto_secretstream_xchacha20poly1305_HEADERBYTES diff --git a/common/htlc.h b/common/htlc.h index c300f0ffe5..b933e07cd0 100644 --- a/common/htlc.h +++ b/common/htlc.h @@ -3,7 +3,6 @@ #include "config.h" #include "bitcoin/locktime.h" #include "htlc_state.h" -#include #include #define NUM_SIDES (REMOTE + 1) diff --git a/common/htlc_tx.h b/common/htlc_tx.h index a08a90f8bd..4e9f09a589 100644 --- a/common/htlc_tx.h +++ b/common/htlc_tx.h @@ -1,7 +1,6 @@ #ifndef LIGHTNING_COMMON_HTLC_TX_H #define LIGHTNING_COMMON_HTLC_TX_H #include "config.h" -#include #include #include #include diff --git a/common/htlc_wire.c b/common/htlc_wire.c index bb17e738b9..3d94471ad5 100644 --- a/common/htlc_wire.c +++ b/common/htlc_wire.c @@ -4,6 +4,7 @@ #include #include #include +#include #include static struct failed_htlc *failed_htlc_dup(const tal_t *ctx, diff --git a/common/initial_commit_tx.h b/common/initial_commit_tx.h index 6e715831b0..7b61b7b8a2 100644 --- a/common/initial_commit_tx.h +++ b/common/initial_commit_tx.h @@ -2,7 +2,6 @@ #ifndef LIGHTNING_COMMON_INITIAL_COMMIT_TX_H #define LIGHTNING_COMMON_INITIAL_COMMIT_TX_H #include "config.h" -#include #include #include #include diff --git a/common/interactivetx.c b/common/interactivetx.c index 6e1aa1c916..2e9a659ae6 100644 --- a/common/interactivetx.c +++ b/common/interactivetx.c @@ -21,7 +21,9 @@ #include #include #include +#include #include +#include #ifndef SUPERVERBOSE #define SUPERVERBOSE(...) diff --git a/common/interactivetx.h b/common/interactivetx.h index af17e1453c..967bb167b7 100644 --- a/common/interactivetx.h +++ b/common/interactivetx.h @@ -2,12 +2,8 @@ #define LIGHTNING_COMMON_INTERACTIVETX_H #include "config.h" -#include #include -#include #include -#include -#include /* Interactive tx handles the building and updating of a transaction between * two peers. A PSBT is passed back and forth between two peers in steps. In diff --git a/common/json_blinded_path.c b/common/json_blinded_path.c index 78ef625e60..2df745e1d5 100644 --- a/common/json_blinded_path.c +++ b/common/json_blinded_path.c @@ -1,7 +1,9 @@ #include "config.h" +#include #include #include -#include +#include +#include struct blinded_path * json_to_blinded_path(const tal_t *ctx, const char *buffer, const jsmntok_t *tok) diff --git a/common/json_command.h b/common/json_command.h index d0c0667f42..7b77cc8e76 100644 --- a/common/json_command.h +++ b/common/json_command.h @@ -3,9 +3,7 @@ #ifndef LIGHTNING_COMMON_JSON_COMMAND_H #define LIGHTNING_COMMON_JSON_COMMAND_H #include "config.h" -#include #include -#include #include struct command; diff --git a/common/json_filter.h b/common/json_filter.h index dee177aebe..3e9116df96 100644 --- a/common/json_filter.h +++ b/common/json_filter.h @@ -4,9 +4,7 @@ #ifndef LIGHTNING_COMMON_JSON_FILTER_H #define LIGHTNING_COMMON_JSON_FILTER_H #include "config.h" -#include #include -#include struct command; struct json_filter; diff --git a/common/json_param.c b/common/json_param.c index c92de191a5..9323b03859 100644 --- a/common/json_param.c +++ b/common/json_param.c @@ -14,6 +14,7 @@ #include #include #include +#include /* Overridden by run-param.c */ #ifndef paramcheck_assert diff --git a/common/json_param.h b/common/json_param.h index e41528a209..a000c71b11 100644 --- a/common/json_param.h +++ b/common/json_param.h @@ -2,13 +2,10 @@ #ifndef LIGHTNING_COMMON_JSON_PARAM_H #define LIGHTNING_COMMON_JSON_PARAM_H #include "config.h" -#include #include #include #include -#include #include -#include /*~ Greetings adventurer! * diff --git a/common/json_parse.c b/common/json_parse.c index 260e9e1b5c..2e4bc9ef13 100644 --- a/common/json_parse.c +++ b/common/json_parse.c @@ -20,7 +20,6 @@ #include #include #include -#include bool json_to_millionths(const char *buffer, const jsmntok_t *tok, u64 *millionths) diff --git a/common/json_parse.h b/common/json_parse.h index 4bd23cbddc..8f3bcfc322 100644 --- a/common/json_parse.h +++ b/common/json_parse.h @@ -2,9 +2,7 @@ #define LIGHTNING_COMMON_JSON_PARSE_H #include "config.h" #include -#include #include -#include /* Simple helpers are here: this file contains heavier ones */ #include #include diff --git a/common/json_parse_simple.c b/common/json_parse_simple.c index e3b2cba820..521b737235 100644 --- a/common/json_parse_simple.c +++ b/common/json_parse_simple.c @@ -8,7 +8,6 @@ #include #include #include -#include const char *json_tok_full(const char *buffer, const jsmntok_t *t) { diff --git a/common/json_stream.h b/common/json_stream.h index bfbb5d0a78..da65761c86 100644 --- a/common/json_stream.h +++ b/common/json_stream.h @@ -9,8 +9,6 @@ # include #include -#include -#include #include #include #include diff --git a/common/jsonrpc_errors.h b/common/jsonrpc_errors.h index da9e337720..48ff078840 100644 --- a/common/jsonrpc_errors.h +++ b/common/jsonrpc_errors.h @@ -6,7 +6,6 @@ #include "config.h" -#include enum jsonrpc_errcode { /* Standard errors defined by JSON-RPC 2.0 standard */ diff --git a/common/key_derive.h b/common/key_derive.h index b078cc9261..8ea5419d34 100644 --- a/common/key_derive.h +++ b/common/key_derive.h @@ -1,7 +1,6 @@ #ifndef LIGHTNING_COMMON_KEY_DERIVE_H #define LIGHTNING_COMMON_KEY_DERIVE_H #include "config.h" -#include #include struct pubkey; diff --git a/common/lease_rates.c b/common/lease_rates.c index 403804e92b..7bcb3ce0c5 100644 --- a/common/lease_rates.c +++ b/common/lease_rates.c @@ -2,6 +2,7 @@ #include #include #include +#include bool lease_rates_empty(const struct lease_rates *rates) { diff --git a/common/lease_rates.h b/common/lease_rates.h index 0b87b38e33..3651f9555b 100644 --- a/common/lease_rates.h +++ b/common/lease_rates.h @@ -1,7 +1,6 @@ #ifndef LIGHTNING_COMMON_LEASE_RATES_H #define LIGHTNING_COMMON_LEASE_RATES_H #include "config.h" -#include #include struct amount_msat; diff --git a/common/memleak.h b/common/memleak.h index a15413b23f..0ff2dc5af0 100644 --- a/common/memleak.h +++ b/common/memleak.h @@ -3,8 +3,6 @@ #include "config.h" #include #include -#include -#include struct htable; struct list_head; diff --git a/common/node_id.h b/common/node_id.h index fa4779c1a3..0f943a44a3 100644 --- a/common/node_id.h +++ b/common/node_id.h @@ -4,7 +4,6 @@ #include "config.h" #include #include -#include #include struct sha256_double; diff --git a/common/onion_decode.c b/common/onion_decode.c index d1bc9b0bde..e82b8a9561 100644 --- a/common/onion_decode.c +++ b/common/onion_decode.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include diff --git a/common/onion_decode.h b/common/onion_decode.h index c1149972b7..f1d637fc60 100644 --- a/common/onion_decode.h +++ b/common/onion_decode.h @@ -1,8 +1,6 @@ #ifndef LIGHTNING_COMMON_ONION_DECODE_H #define LIGHTNING_COMMON_ONION_DECODE_H #include "config.h" -#include -#include #include /** diff --git a/common/onion_encode.c b/common/onion_encode.c index ee9747189b..e5ff5d9972 100644 --- a/common/onion_encode.c +++ b/common/onion_encode.c @@ -7,6 +7,7 @@ #include #include #include +#include #include /* BOLT #4: diff --git a/common/onion_message.c b/common/onion_message.c index c781866ee7..e887d42aa7 100644 --- a/common/onion_message.c +++ b/common/onion_message.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include struct tlv_encrypted_data_tlv **new_encdata_tlvs(const tal_t *ctx, const struct pubkey *ids, diff --git a/common/onion_message.h b/common/onion_message.h index 03139828d5..e5da47d498 100644 --- a/common/onion_message.h +++ b/common/onion_message.h @@ -1,7 +1,6 @@ #ifndef LIGHTNING_COMMON_ONION_MESSAGE_H #define LIGHTNING_COMMON_ONION_MESSAGE_H #include "config.h" -#include #include #include diff --git a/common/onion_message_parse.c b/common/onion_message_parse.c index 9becf60d13..c2184dbd75 100644 --- a/common/onion_message_parse.c +++ b/common/onion_message_parse.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include static bool decrypt_final_onionmsg(const tal_t *ctx, diff --git a/common/onion_message_parse.h b/common/onion_message_parse.h index af4c519089..6cc1b126ad 100644 --- a/common/onion_message_parse.h +++ b/common/onion_message_parse.h @@ -2,7 +2,6 @@ #define LIGHTNING_COMMON_ONION_MESSAGE_PARSE_H #include "config.h" #include -#include struct tlv_onionmsg_tlv; struct sciddir_or_pubkey; diff --git a/common/peer_failed.c b/common/peer_failed.c index f21754e3a9..e9864e363f 100644 --- a/common/peer_failed.c +++ b/common/peer_failed.c @@ -8,6 +8,7 @@ #include #include #include +#include #include /* Fatal error here, return peer control to lightningd */ diff --git a/common/per_peer_state.h b/common/per_peer_state.h index 0561d8ce28..23dce68331 100644 --- a/common/per_peer_state.h +++ b/common/per_peer_state.h @@ -2,8 +2,6 @@ #define LIGHTNING_COMMON_PER_PEER_STATE_H #include "config.h" -#include -#include #include /* Things we hand between daemons to talk to peers. */ diff --git a/common/psbt_internal.c b/common/psbt_internal.c index 44501d6dfb..55c50e54aa 100644 --- a/common/psbt_internal.c +++ b/common/psbt_internal.c @@ -5,6 +5,7 @@ #include #include #include +#include #include diff --git a/common/psbt_open.h b/common/psbt_open.h index b3c74c92ad..da0d30d426 100644 --- a/common/psbt_open.h +++ b/common/psbt_open.h @@ -1,7 +1,6 @@ #ifndef LIGHTNING_COMMON_PSBT_OPEN_H #define LIGHTNING_COMMON_PSBT_OPEN_H #include "config.h" -#include #include #include #include diff --git a/common/pseudorand.c b/common/pseudorand.c index 831be2bb58..a9c5dfa821 100644 --- a/common/pseudorand.c +++ b/common/pseudorand.c @@ -1,7 +1,6 @@ #include "config.h" #include #include -#include #include #include #include diff --git a/common/pseudorand.h b/common/pseudorand.h index a342200555..ebe9e0b59a 100644 --- a/common/pseudorand.h +++ b/common/pseudorand.h @@ -1,6 +1,7 @@ #ifndef LIGHTNING_COMMON_PSEUDORAND_H #define LIGHTNING_COMMON_PSEUDORAND_H #include "config.h" +#include #include #include diff --git a/common/read_peer_msg.c b/common/read_peer_msg.c index b10de75e17..a371cf9521 100644 --- a/common/read_peer_msg.c +++ b/common/read_peer_msg.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include diff --git a/common/scb_wire.csv b/common/scb_wire.csv index f955b6bca5..537c564ca5 100644 --- a/common/scb_wire.csv +++ b/common/scb_wire.csv @@ -7,6 +7,7 @@ #include #include #include +#include tlvtype,scb_tlvs,shachain,1, tlvdata,scb_tlvs,shachain,their_shachain,shachain, diff --git a/common/shutdown_scriptpubkey.c b/common/shutdown_scriptpubkey.c index 05d7b22e95..6c82baf268 100644 --- a/common/shutdown_scriptpubkey.c +++ b/common/shutdown_scriptpubkey.c @@ -1,6 +1,7 @@ #include "config.h" #include #include +#include #include /* BOLT #2: diff --git a/common/sphinx.c b/common/sphinx.c index c254e63170..e44055022c 100644 --- a/common/sphinx.c +++ b/common/sphinx.c @@ -7,7 +7,7 @@ #include #include #include - +#include #include diff --git a/common/sphinx.h b/common/sphinx.h index 933e82627b..b559d61a85 100644 --- a/common/sphinx.h +++ b/common/sphinx.h @@ -6,7 +6,7 @@ #include "bitcoin/pubkey.h" #include -#include +#include struct node_id; diff --git a/common/splice_script.h b/common/splice_script.h index 17b3de2891..fd2c9b07bb 100644 --- a/common/splice_script.h +++ b/common/splice_script.h @@ -2,7 +2,6 @@ #define LIGHTNING_COMMON_SPLICE_SCRIPT_H #include "config.h" -#include #include #include #include diff --git a/common/status.c b/common/status.c index 87a5540038..7de0ebdfa6 100644 --- a/common/status.c +++ b/common/status.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include diff --git a/common/test/run-bolt12-format-string-test.c b/common/test/run-bolt12-format-string-test.c index dc8384750a..e120af65f6 100644 --- a/common/test/run-bolt12-format-string-test.c +++ b/common/test/run-bolt12-format-string-test.c @@ -9,6 +9,7 @@ #include #include #include +#include /* AUTOGENERATED MOCKS START */ /* Generated stub for features_unsupported */ diff --git a/common/test/run-bolt12_merkle-json.c b/common/test/run-bolt12_merkle-json.c index 4c0910d3f5..dba66a2957 100644 --- a/common/test/run-bolt12_merkle-json.c +++ b/common/test/run-bolt12_merkle-json.c @@ -8,6 +8,7 @@ #include "../../wire/fromwire.c" #include "../../wire/peer_wiregen.c" #include "../../wire/tlvstream.c" +#include #include #include #include diff --git a/common/test/run-cryptomsg.c b/common/test/run-cryptomsg.c index 42fa16e89c..9b7619d95b 100644 --- a/common/test/run-cryptomsg.c +++ b/common/test/run-cryptomsg.c @@ -2,6 +2,7 @@ #include #include #include +#include #include #include diff --git a/common/test/run-json.c b/common/test/run-json.c index b5fdecdb3c..529d96c62c 100644 --- a/common/test/run-json.c +++ b/common/test/run-json.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include diff --git a/common/trace.c b/common/trace.c index eade3171f7..a91adf2b3a 100644 --- a/common/trace.c +++ b/common/trace.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include diff --git a/common/utils.h b/common/utils.h index 26992fdb06..45b91f87f8 100644 --- a/common/utils.h +++ b/common/utils.h @@ -1,7 +1,6 @@ #ifndef LIGHTNING_COMMON_UTILS_H #define LIGHTNING_COMMON_UTILS_H #include "config.h" -#include #include #include #include diff --git a/common/wire_error.c b/common/wire_error.c index 512a1cf6b7..bf82176005 100644 --- a/common/wire_error.c +++ b/common/wire_error.c @@ -1,6 +1,7 @@ #include "config.h" #include #include +#include #include #include diff --git a/connectd/connectd.c b/connectd/connectd.c index f04f2caa79..17ec7d3a38 100644 --- a/connectd/connectd.c +++ b/connectd/connectd.c @@ -19,8 +19,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -29,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/connectd/connectd.h b/connectd/connectd.h index 5774c220f4..09778e2d50 100644 --- a/connectd/connectd.h +++ b/connectd/connectd.h @@ -1,16 +1,12 @@ #ifndef LIGHTNING_CONNECTD_CONNECTD_H #define LIGHTNING_CONNECTD_CONNECTD_H #include "config.h" -#include #include -#include #include #include #include -#include #include #include -#include #include #include diff --git a/connectd/connectd_gossipd_wire.csv b/connectd/connectd_gossipd_wire.csv index 195a73421b..d6be886a65 100644 --- a/connectd/connectd_gossipd_wire.csv +++ b/connectd/connectd_gossipd_wire.csv @@ -1,6 +1,4 @@ #include -#include -#include # Communication between gossipd and connectd. msgtype,gossipd_new_peer,4000 diff --git a/connectd/connectd_wire.csv b/connectd/connectd_wire.csv index 23b7d37da1..78df85efc8 100644 --- a/connectd/connectd_wire.csv +++ b/connectd/connectd_wire.csv @@ -1,10 +1,8 @@ -#include #include -#include #include #include #include -#include +#include msgtype,connectd_init,2000 msgdata,connectd_init,chainparams,chainparams, diff --git a/connectd/gossip_store.c b/connectd/gossip_store.c index 7a6bb61dc0..60da90f30b 100644 --- a/connectd/gossip_store.c +++ b/connectd/gossip_store.c @@ -1,6 +1,7 @@ #include "config.h" #include #include +#include #include #include #include diff --git a/connectd/multiplex.c b/connectd/multiplex.c index d2c725355d..77cdfd50a2 100644 --- a/connectd/multiplex.c +++ b/connectd/multiplex.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include diff --git a/connectd/onion_message.c b/connectd/onion_message.c index 09940e855b..1a9b42b0ff 100644 --- a/connectd/onion_message.c +++ b/connectd/onion_message.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/connectd/peer_exchange_initmsg.c b/connectd/peer_exchange_initmsg.c index b0a29549ca..de43633fa6 100644 --- a/connectd/peer_exchange_initmsg.c +++ b/connectd/peer_exchange_initmsg.c @@ -1,9 +1,11 @@ #include "config.h" #include #include +#include #include #include #include +#include #include #include #include diff --git a/connectd/queries.c b/connectd/queries.c index 3a680cb75b..351c469395 100644 --- a/connectd/queries.c +++ b/connectd/queries.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include diff --git a/db/common.h b/db/common.h index 1ffd26344e..829a3d2cf9 100644 --- a/db/common.h +++ b/db/common.h @@ -2,11 +2,8 @@ #define LIGHTNING_DB_COMMON_H #include "config.h" #include -#include -#include #include #include -#include /** * Macro to annotate a named SQL query. diff --git a/db/utils.c b/db/utils.c index 155efbd44c..3b896f9c7a 100644 --- a/db/utils.c +++ b/db/utils.c @@ -1,4 +1,5 @@ #include "config.h" +#include #include #include #include diff --git a/devtools/bolt11-cli.c b/devtools/bolt11-cli.c index 5553822c67..02204fb15b 100644 --- a/devtools/bolt11-cli.c +++ b/devtools/bolt11-cli.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include diff --git a/devtools/bolt12-cli.c b/devtools/bolt12-cli.c index 830d2744a6..0aa6adc85b 100644 --- a/devtools/bolt12-cli.c +++ b/devtools/bolt12-cli.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include diff --git a/devtools/checkchannels.c b/devtools/checkchannels.c index bf7746d08f..235b110969 100644 --- a/devtools/checkchannels.c +++ b/devtools/checkchannels.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include diff --git a/devtools/convert-gossmap.c b/devtools/convert-gossmap.c index dee2b1f1e6..96ea795634 100644 --- a/devtools/convert-gossmap.c +++ b/devtools/convert-gossmap.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include diff --git a/devtools/create-gossipstore.c b/devtools/create-gossipstore.c index b9376f4742..320ad9f37e 100644 --- a/devtools/create-gossipstore.c +++ b/devtools/create-gossipstore.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include diff --git a/devtools/decodemsg.c b/devtools/decodemsg.c index 2a5d05c7ef..390a409308 100644 --- a/devtools/decodemsg.c +++ b/devtools/decodemsg.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include diff --git a/devtools/dump-gossipstore.c b/devtools/dump-gossipstore.c index ced6a5a06c..2d69b06370 100644 --- a/devtools/dump-gossipstore.c +++ b/devtools/dump-gossipstore.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include diff --git a/devtools/gossipwith.c b/devtools/gossipwith.c index f506787cd4..254e61943b 100644 --- a/devtools/gossipwith.c +++ b/devtools/gossipwith.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include diff --git a/devtools/gossmap-compress.c b/devtools/gossmap-compress.c index 0847fc1bff..58ef255ac1 100644 --- a/devtools/gossmap-compress.c +++ b/devtools/gossmap-compress.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include diff --git a/devtools/mkcommit.c b/devtools/mkcommit.c index 069282b2f3..3cfe80ba2b 100644 --- a/devtools/mkcommit.c +++ b/devtools/mkcommit.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include diff --git a/devtools/mkencoded.c b/devtools/mkencoded.c index 6ff556be98..ba6f40db1c 100644 --- a/devtools/mkencoded.c +++ b/devtools/mkencoded.c @@ -4,6 +4,7 @@ #include #include #include +#include #include static NORETURN void usage(void) diff --git a/devtools/mkgossip.c b/devtools/mkgossip.c index 374b914271..b68d8cfe6c 100644 --- a/devtools/mkgossip.c +++ b/devtools/mkgossip.c @@ -8,11 +8,13 @@ */ #include "config.h" #include +#include #include #include #include #include #include +#include #include #include #include diff --git a/devtools/mkquery.c b/devtools/mkquery.c index 3bb4cef7a2..9fe6e69f85 100644 --- a/devtools/mkquery.c +++ b/devtools/mkquery.c @@ -2,6 +2,7 @@ #include "config.h" #include #include +#include #include #include diff --git a/devtools/onion.c b/devtools/onion.c index ca723afd5a..ee2f53138a 100644 --- a/devtools/onion.c +++ b/devtools/onion.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include diff --git a/devtools/print_wire.c b/devtools/print_wire.c index 15669899dd..ba1285fff9 100644 --- a/devtools/print_wire.c +++ b/devtools/print_wire.c @@ -1,8 +1,13 @@ #include "config.h" +#include +#include +#include #include #include +#include #include #include +#include #include #include #include diff --git a/devtools/print_wire.h b/devtools/print_wire.h index 40c86d2357..0a2a137977 100644 --- a/devtools/print_wire.h +++ b/devtools/print_wire.h @@ -1,11 +1,7 @@ #ifndef LIGHTNING_DEVTOOLS_PRINT_WIRE_H #define LIGHTNING_DEVTOOLS_PRINT_WIRE_H #include "config.h" -#include -#include -#include -#include -#include +#include struct tlv_print_record_type { u64 type; diff --git a/devtools/route.c b/devtools/route.c index 684d04cb7a..d13e3cf9d3 100644 --- a/devtools/route.c +++ b/devtools/route.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include diff --git a/devtools/topology.c b/devtools/topology.c index 649e669537..181809d22d 100644 --- a/devtools/topology.c +++ b/devtools/topology.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include diff --git a/gossipd/gossip_store.c b/gossipd/gossip_store.c index 15cae6bdec..4d49077777 100644 --- a/gossipd/gossip_store.c +++ b/gossipd/gossip_store.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include diff --git a/gossipd/gossip_store.h b/gossipd/gossip_store.h index 96ff0937f7..853b772d77 100644 --- a/gossipd/gossip_store.h +++ b/gossipd/gossip_store.h @@ -4,9 +4,6 @@ #include "config.h" #include -#include -#include -#include /** * gossip_store -- On-disk storage related information diff --git a/gossipd/gossipd.c b/gossipd/gossipd.c index 4180705080..14b795fd20 100644 --- a/gossipd/gossipd.c +++ b/gossipd/gossipd.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include diff --git a/gossipd/gossipd.h b/gossipd/gossipd.h index 8318156348..9ee193e55a 100644 --- a/gossipd/gossipd.h +++ b/gossipd/gossipd.h @@ -2,6 +2,7 @@ #define LIGHTNING_GOSSIPD_GOSSIPD_H #include "config.h" #include +#include #include #include #include diff --git a/gossipd/gossipd_wire.csv b/gossipd/gossipd_wire.csv index d8bee4b298..c5868eb748 100644 --- a/gossipd/gossipd_wire.csv +++ b/gossipd/gossipd_wire.csv @@ -2,7 +2,7 @@ #include #include #include -#include +#include # Initialize the gossip daemon. msgtype,gossipd_init,3000 diff --git a/gossipd/gossmap_manage.c b/gossipd/gossmap_manage.c index 816c3f00ea..72c94f3b20 100644 --- a/gossipd/gossmap_manage.c +++ b/gossipd/gossmap_manage.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include diff --git a/gossipd/queries.c b/gossipd/queries.c index 707933fac7..8902a5fc9a 100644 --- a/gossipd/queries.c +++ b/gossipd/queries.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include diff --git a/gossipd/seeker.c b/gossipd/seeker.c index 414aa3e736..b822cb732a 100644 --- a/gossipd/seeker.c +++ b/gossipd/seeker.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include diff --git a/hsmd/hsm_utxo.h b/hsmd/hsm_utxo.h index 62bea00262..b7d8d71824 100644 --- a/hsmd/hsm_utxo.h +++ b/hsmd/hsm_utxo.h @@ -1,8 +1,6 @@ #ifndef LIGHTNING_HSMD_HSM_UTXO_H #define LIGHTNING_HSMD_HSM_UTXO_H #include "config.h" -#include -#include #include /* FIXME: If we make our static_remotekey a normal keypath key, we can diff --git a/hsmd/hsmd.c b/hsmd/hsmd.c index ff6d1e7b2c..2d05e657e8 100644 --- a/hsmd/hsmd.c +++ b/hsmd/hsmd.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include /*~ _wiregen files are autogenerated by tools/generate-wire.py */ diff --git a/hsmd/hsmd_wire.csv b/hsmd/hsmd_wire.csv index 4a8c7c7d9e..4f4a40d1e3 100644 --- a/hsmd/hsmd_wire.csv +++ b/hsmd/hsmd_wire.csv @@ -392,6 +392,7 @@ msgdata,hsmd_sign_bolt12,merkleroot,sha256, msgdata,hsmd_sign_bolt12,publictweaklen,u16, msgdata,hsmd_sign_bolt12,publictweak,u8,publictweaklen +#include msgtype,hsmd_sign_bolt12_reply,125 msgdata,hsmd_sign_bolt12_reply,sig,bip340sig, diff --git a/hsmd/libhsmd.c b/hsmd/libhsmd.c index 7e51fd85df..f459f03f15 100644 --- a/hsmd/libhsmd.c +++ b/hsmd/libhsmd.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include diff --git a/hsmd/libhsmd.h b/hsmd/libhsmd.h index db927284bc..652340e212 100644 --- a/hsmd/libhsmd.h +++ b/hsmd/libhsmd.h @@ -2,7 +2,6 @@ #define LIGHTNING_HSMD_LIBHSMD_H #include "config.h" -#include #include #include diff --git a/lightningd/bitcoind.h b/lightningd/bitcoind.h index cf92e90751..3daa509055 100644 --- a/lightningd/bitcoind.h +++ b/lightningd/bitcoind.h @@ -1,7 +1,6 @@ #ifndef LIGHTNING_LIGHTNINGD_BITCOIND_H #define LIGHTNING_LIGHTNINGD_BITCOIND_H #include "config.h" -#include #include #include #include diff --git a/lightningd/chaintopology.c b/lightningd/chaintopology.c index 59f004f732..1baab407f4 100644 --- a/lightningd/chaintopology.c +++ b/lightningd/chaintopology.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include diff --git a/lightningd/chaintopology.h b/lightningd/chaintopology.h index 4f80d21622..f6aa818875 100644 --- a/lightningd/chaintopology.h +++ b/lightningd/chaintopology.h @@ -1,9 +1,6 @@ #ifndef LIGHTNING_LIGHTNINGD_CHAINTOPOLOGY_H #define LIGHTNING_LIGHTNINGD_CHAINTOPOLOGY_H #include "config.h" -#include -#include -#include #include struct bitcoin_tx; diff --git a/lightningd/channel.h b/lightningd/channel.h index fd8e031b0c..3606d0f989 100644 --- a/lightningd/channel.h +++ b/lightningd/channel.h @@ -1,6 +1,7 @@ #ifndef LIGHTNING_LIGHTNINGD_CHANNEL_H #define LIGHTNING_LIGHTNINGD_CHANNEL_H #include "config.h" +#include #include #include #include diff --git a/lightningd/channel_control.c b/lightningd/channel_control.c index a72f959837..93d76a7adb 100644 --- a/lightningd/channel_control.c +++ b/lightningd/channel_control.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include diff --git a/lightningd/channel_state.h b/lightningd/channel_state.h index 26d12d81d6..9db105fb1f 100644 --- a/lightningd/channel_state.h +++ b/lightningd/channel_state.h @@ -2,7 +2,6 @@ #define LIGHTNING_LIGHTNINGD_CHANNEL_STATE_H #include "config.h" -#include /* These are in the database, so don't renumber them! */ enum channel_state { diff --git a/lightningd/closing_control.c b/lightningd/closing_control.c index 36fe90f696..dbf604bc46 100644 --- a/lightningd/closing_control.c +++ b/lightningd/closing_control.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/lightningd/connect_control.c b/lightningd/connect_control.c index 2cdeb610ba..437beaa9e0 100644 --- a/lightningd/connect_control.c +++ b/lightningd/connect_control.c @@ -1,6 +1,7 @@ #include "config.h" #include #include +#include #include #include #include diff --git a/lightningd/dual_open_control.c b/lightningd/dual_open_control.c index ab84e3f498..8e6a651693 100644 --- a/lightningd/dual_open_control.c +++ b/lightningd/dual_open_control.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include diff --git a/lightningd/forwards.h b/lightningd/forwards.h index f65dd16873..0436035b1e 100644 --- a/lightningd/forwards.h +++ b/lightningd/forwards.h @@ -2,7 +2,8 @@ #ifndef LIGHTNING_LIGHTNINGD_FORWARDS_H #define LIGHTNING_LIGHTNINGD_FORWARDS_H #include "config.h" -#include +#include +#include struct json_stream; struct lightningd; diff --git a/lightningd/gossip_control.c b/lightningd/gossip_control.c index 4e931a7844..207e41b57e 100644 --- a/lightningd/gossip_control.c +++ b/lightningd/gossip_control.c @@ -1,5 +1,6 @@ #include "config.h" #include +#include #include #include #include diff --git a/lightningd/gossip_control.h b/lightningd/gossip_control.h index 06a248799d..49baa7fffb 100644 --- a/lightningd/gossip_control.h +++ b/lightningd/gossip_control.h @@ -2,8 +2,6 @@ #define LIGHTNING_LIGHTNINGD_GOSSIP_CONTROL_H #include "config.h" #include -#include -#include struct channel; struct lightningd; diff --git a/lightningd/htlc_end.c b/lightningd/htlc_end.c index 91d66b0c33..b55780874e 100644 --- a/lightningd/htlc_end.c +++ b/lightningd/htlc_end.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include diff --git a/lightningd/htlc_set.h b/lightningd/htlc_set.h index c93ca15361..bb0119dc3c 100644 --- a/lightningd/htlc_set.h +++ b/lightningd/htlc_set.h @@ -7,7 +7,6 @@ #include #include #include -#include struct lightningd; struct logger; diff --git a/lightningd/invoice.h b/lightningd/invoice.h index 90c31cb271..43e98b2a13 100644 --- a/lightningd/invoice.h +++ b/lightningd/invoice.h @@ -2,7 +2,6 @@ #define LIGHTNING_LIGHTNINGD_INVOICE_H #include "config.h" #include -#include struct amount_msat; struct htlc_set; diff --git a/lightningd/lightningd.c b/lightningd/lightningd.c index 5a350daeb4..7044d9796f 100644 --- a/lightningd/lightningd.c +++ b/lightningd/lightningd.c @@ -37,6 +37,7 @@ */ #include #include +#include #include #include #include @@ -51,6 +52,7 @@ #include #include #include +#include #include #include #include diff --git a/lightningd/opening_common.h b/lightningd/opening_common.h index 8b75b56a02..21ca82286b 100644 --- a/lightningd/opening_common.h +++ b/lightningd/opening_common.h @@ -1,8 +1,6 @@ #ifndef LIGHTNING_LIGHTNINGD_OPENING_COMMON_H #define LIGHTNING_LIGHTNINGD_OPENING_COMMON_H #include "config.h" -#include -#include #include #include #include diff --git a/lightningd/opening_control.c b/lightningd/opening_control.c index 7c12a0ffd5..ffd6cab56b 100644 --- a/lightningd/opening_control.c +++ b/lightningd/opening_control.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/lightningd/options.c b/lightningd/options.c index e565c62f94..5f84b72858 100644 --- a/lightningd/options.c +++ b/lightningd/options.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -26,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index fa458cb2b0..98f596b2e2 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -71,7 +71,6 @@ #include #include #include -#include #include /* FIXME: Reorder! */ diff --git a/lightningd/peer_fd.h b/lightningd/peer_fd.h index a6e1f011fd..89041260ec 100644 --- a/lightningd/peer_fd.h +++ b/lightningd/peer_fd.h @@ -1,7 +1,6 @@ #ifndef LIGHTNING_LIGHTNINGD_PEER_FD_H #define LIGHTNING_LIGHTNINGD_PEER_FD_H #include "config.h" -#include #include /* Tal wrapper for fd connecting subd to connectd */ diff --git a/lightningd/runes.c b/lightningd/runes.c index 77be7a30a0..9085497839 100644 --- a/lightningd/runes.c +++ b/lightningd/runes.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include diff --git a/lightningd/subd.c b/lightningd/subd.c index 263ce03c6b..c3f59f01b6 100644 --- a/lightningd/subd.c +++ b/lightningd/subd.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include diff --git a/lightningd/subd.h b/lightningd/subd.h index c572a77d05..8518b06559 100644 --- a/lightningd/subd.h +++ b/lightningd/subd.h @@ -1,12 +1,7 @@ #ifndef LIGHTNING_LIGHTNINGD_SUBD_H #define LIGHTNING_LIGHTNINGD_SUBD_H #include "config.h" -#include #include -#include -#include -#include -#include #include struct crypto_state; diff --git a/onchaind/onchaind.c b/onchaind/onchaind.c index 0fbc8666fd..024aaf4a05 100644 --- a/onchaind/onchaind.c +++ b/onchaind/onchaind.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include diff --git a/onchaind/onchaind_wire.csv b/onchaind/onchaind_wire.csv index f8f5e8eab8..3c9c76bbaf 100644 --- a/onchaind/onchaind_wire.csv +++ b/onchaind/onchaind_wire.csv @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/openingd/common.h b/openingd/common.h index aab8bd8484..3464494857 100644 --- a/openingd/common.h +++ b/openingd/common.h @@ -2,6 +2,7 @@ #define LIGHTNING_OPENINGD_COMMON_H #include "config.h" +#include struct amount_sat; struct bitcoin_tx; diff --git a/openingd/dualopend.c b/openingd/dualopend.c index 8e902fa596..eeca9056a2 100644 --- a/openingd/dualopend.c +++ b/openingd/dualopend.c @@ -38,9 +38,11 @@ #include #include #include +#include #include #include #include +#include #include /* stdin == lightningd, 3 == peer, 4 = hsmd */ diff --git a/openingd/dualopend_wire.csv b/openingd/dualopend_wire.csv index 34841392ff..d6b1574954 100644 --- a/openingd/dualopend_wire.csv +++ b/openingd/dualopend_wire.csv @@ -1,5 +1,6 @@ #include #include +#include #include #include #include diff --git a/openingd/openingd_wire.csv b/openingd/openingd_wire.csv index c70de6cf01..f96c50b003 100644 --- a/openingd/openingd_wire.csv +++ b/openingd/openingd_wire.csv @@ -1,4 +1,5 @@ #include +#include #include #include #include diff --git a/plugins/askrene/askrene.c b/plugins/askrene/askrene.c index 9664d2487d..fff49c0544 100644 --- a/plugins/askrene/askrene.c +++ b/plugins/askrene/askrene.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include diff --git a/plugins/askrene/mcf.c b/plugins/askrene/mcf.c index 4614fb49c5..8d69511eb6 100644 --- a/plugins/askrene/mcf.c +++ b/plugins/askrene/mcf.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include diff --git a/plugins/askrene/reserve.c b/plugins/askrene/reserve.c index abec9372df..59457fc246 100644 --- a/plugins/askrene/reserve.c +++ b/plugins/askrene/reserve.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include diff --git a/plugins/autoclean.c b/plugins/autoclean.c index bfd358c988..8be8ce2b68 100644 --- a/plugins/autoclean.c +++ b/plugins/autoclean.c @@ -6,6 +6,7 @@ #include #include #include +#include #include static u64 cycle_seconds = 3600; diff --git a/plugins/bcli.c b/plugins/bcli.c index fdd5a7c6e2..b1e655b99b 100644 --- a/plugins/bcli.c +++ b/plugins/bcli.c @@ -11,6 +11,7 @@ #include #include #include +#include #include /* Bitcoind's web server has a default of 4 threads, with queue depth 16. diff --git a/plugins/bkpr/bookkeeper.c b/plugins/bkpr/bookkeeper.c index 75fb76ad5a..93f44e5c22 100644 --- a/plugins/bkpr/bookkeeper.c +++ b/plugins/bkpr/bookkeeper.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include diff --git a/plugins/bkpr/rebalances.c b/plugins/bkpr/rebalances.c index 38bbdcd842..91d9dd6f9a 100644 --- a/plugins/bkpr/rebalances.c +++ b/plugins/bkpr/rebalances.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include diff --git a/plugins/chanbackup.c b/plugins/chanbackup.c index 11091edd92..034c3ecffa 100644 --- a/plugins/chanbackup.c +++ b/plugins/chanbackup.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/plugins/channel_hint.c b/plugins/channel_hint.c index 1db37791ea..cf431cb85d 100644 --- a/plugins/channel_hint.c +++ b/plugins/channel_hint.c @@ -1,4 +1,5 @@ #include "config.h" +#include #include #include diff --git a/plugins/channel_hint.h b/plugins/channel_hint.h index 200458f822..db94c5b3ec 100644 --- a/plugins/channel_hint.h +++ b/plugins/channel_hint.h @@ -2,11 +2,6 @@ #define LIGHTNING_PLUGINS_CHANNEL_HINT_H #include "config.h" -#include -#include -#include -#include -#include #include /* Information about channels we inferred from a) looking at our channels, and diff --git a/plugins/commando.c b/plugins/commando.c index 608e8dfe92..ae23d7a62a 100644 --- a/plugins/commando.c +++ b/plugins/commando.c @@ -13,6 +13,7 @@ #include #include #include +#include #include /* We (as your local commando command) detected an error. */ diff --git a/plugins/establish_onion_path.c b/plugins/establish_onion_path.c index bfef89ceae..c74bc4430d 100644 --- a/plugins/establish_onion_path.c +++ b/plugins/establish_onion_path.c @@ -1,6 +1,7 @@ #include "config.h" #include #include +#include #include #include #include diff --git a/plugins/establish_onion_path.h b/plugins/establish_onion_path.h index bb9a055c46..19411fef68 100644 --- a/plugins/establish_onion_path.h +++ b/plugins/establish_onion_path.h @@ -1,7 +1,6 @@ #ifndef LIGHTNING_PLUGINS_ESTABLISH_ONION_PATH_H #define LIGHTNING_PLUGINS_ESTABLISH_ONION_PATH_H #include "config.h" -#include #include struct gossmap; diff --git a/plugins/fetchinvoice.c b/plugins/fetchinvoice.c index c7013e694f..10362e8aaa 100644 --- a/plugins/fetchinvoice.c +++ b/plugins/fetchinvoice.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -20,6 +21,7 @@ #include #include #include +#include #include #include #include diff --git a/plugins/funder.c b/plugins/funder.c index cae9534db3..af2997b3ea 100644 --- a/plugins/funder.c +++ b/plugins/funder.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include diff --git a/plugins/keysend.c b/plugins/keysend.c index 6104bf607c..79a6600da3 100644 --- a/plugins/keysend.c +++ b/plugins/keysend.c @@ -4,11 +4,14 @@ #include #include #include +#include #include #include #include #include #include +#include +#include #include #include diff --git a/plugins/libplugin-pay.c b/plugins/libplugin-pay.c index 5409e00ebb..9b3bd5fd96 100644 --- a/plugins/libplugin-pay.c +++ b/plugins/libplugin-pay.c @@ -3,17 +3,22 @@ #include #include #include +#include #include #include +#include #include #include #include #include #include #include +#include #include #include +#include #include +#include #include #include #include diff --git a/plugins/libplugin-pay.h b/plugins/libplugin-pay.h index bc1ec51b5d..4df7d3fcaf 100644 --- a/plugins/libplugin-pay.h +++ b/plugins/libplugin-pay.h @@ -3,11 +3,8 @@ #include "config.h" #include -#include -#include -#include #include -#include +#include struct legacy_payload { struct short_channel_id scid; diff --git a/plugins/libplugin.c b/plugins/libplugin.c index 167d136210..6e74026047 100644 --- a/plugins/libplugin.c +++ b/plugins/libplugin.c @@ -3,11 +3,13 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -17,6 +19,7 @@ #include #include #include +#include #include #include #include diff --git a/plugins/libplugin.h b/plugins/libplugin.h index 5504299509..cec028b2fe 100644 --- a/plugins/libplugin.h +++ b/plugins/libplugin.h @@ -3,21 +3,11 @@ #define LIGHTNING_PLUGINS_LIBPLUGIN_H #include "config.h" -#include -#include -#include -#include -#include #include -#include -#include #include #include -#include #include -#include #include -#include struct json_out; struct htable; diff --git a/plugins/offers.c b/plugins/offers.c index 575d7a8b05..5daf8b63ae 100644 --- a/plugins/offers.c +++ b/plugins/offers.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -19,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/plugins/offers_inv_hook.c b/plugins/offers_inv_hook.c index 07bc1a7ed6..4772899fb7 100644 --- a/plugins/offers_inv_hook.c +++ b/plugins/offers_inv_hook.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include diff --git a/plugins/offers_invreq_hook.c b/plugins/offers_invreq_hook.c index 5c8cb142c4..3a7574f248 100644 --- a/plugins/offers_invreq_hook.c +++ b/plugins/offers_invreq_hook.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -15,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/plugins/offers_offer.c b/plugins/offers_offer.c index e7c7ded189..77eae2c9bb 100644 --- a/plugins/offers_offer.c +++ b/plugins/offers_offer.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include diff --git a/plugins/pay.c b/plugins/pay.c index 7deaf85bc5..20de6e1b0b 100644 --- a/plugins/pay.c +++ b/plugins/pay.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include diff --git a/plugins/renepay/disabledmap.c b/plugins/renepay/disabledmap.c index 68492eced3..badeac8686 100644 --- a/plugins/renepay/disabledmap.c +++ b/plugins/renepay/disabledmap.c @@ -1,4 +1,5 @@ #include "config.h" +#include #include struct disabledmap *disabledmap_new(const tal_t *ctx) diff --git a/plugins/renepay/main.c b/plugins/renepay/main.c index 01b4d13be3..8d92ea78e8 100644 --- a/plugins/renepay/main.c +++ b/plugins/renepay/main.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include diff --git a/plugins/spender/multifundchannel.c b/plugins/spender/multifundchannel.c index 5fef05204c..af425736e7 100644 --- a/plugins/spender/multifundchannel.c +++ b/plugins/spender/multifundchannel.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include diff --git a/plugins/spender/multiwithdraw.c b/plugins/spender/multiwithdraw.c index c6f448131e..7950d1d1c9 100644 --- a/plugins/spender/multiwithdraw.c +++ b/plugins/spender/multiwithdraw.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include diff --git a/plugins/spender/openchannel.c b/plugins/spender/openchannel.c index 90c5cdb28a..85d15b06f9 100644 --- a/plugins/spender/openchannel.c +++ b/plugins/spender/openchannel.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include diff --git a/plugins/spender/splice.c b/plugins/spender/splice.c index 1c8ce72fa9..35098c0c7f 100644 --- a/plugins/spender/splice.c +++ b/plugins/spender/splice.c @@ -11,6 +11,7 @@ #include #include #include +#include #include struct abort_pkg { diff --git a/plugins/topology.c b/plugins/topology.c index 4c84d02b92..4a440846b1 100644 --- a/plugins/topology.c +++ b/plugins/topology.c @@ -14,6 +14,7 @@ #include #include #include +#include #include /* Access via get_gossmap() */ diff --git a/plugins/xpay/xpay.c b/plugins/xpay/xpay.c index bf5f9cb462..b4e2c41102 100644 --- a/plugins/xpay/xpay.c +++ b/plugins/xpay/xpay.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -20,6 +21,7 @@ #include #include #include +#include #include #include diff --git a/tests/fuzz/fuzz-bolt12-invrequest-decode.c b/tests/fuzz/fuzz-bolt12-invrequest-decode.c index 5a3ba5d238..159fb26b7c 100644 --- a/tests/fuzz/fuzz-bolt12-invrequest-decode.c +++ b/tests/fuzz/fuzz-bolt12-invrequest-decode.c @@ -1,4 +1,5 @@ #include "config.h" +#include #include #include #include diff --git a/tests/fuzz/libfuzz.h b/tests/fuzz/libfuzz.h index cd095035ac..332caa3e83 100644 --- a/tests/fuzz/libfuzz.h +++ b/tests/fuzz/libfuzz.h @@ -4,6 +4,7 @@ #include "config.h" #include #include +#include #include #include diff --git a/tests/plugins/channeld_fakenet.c b/tests/plugins/channeld_fakenet.c index fc08d2bf13..d56c5824fb 100644 --- a/tests/plugins/channeld_fakenet.c +++ b/tests/plugins/channeld_fakenet.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/tools/hsmtool.c b/tools/hsmtool.c index 7f2d30fb9d..484ef2b4c6 100644 --- a/tools/hsmtool.c +++ b/tools/hsmtool.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff --git a/wallet/reservation.c b/wallet/reservation.c index 9c100a0cc4..23cdaad5b6 100644 --- a/wallet/reservation.c +++ b/wallet/reservation.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include diff --git a/wallet/test/run-wallet.c b/wallet/test/run-wallet.c index 0c29382b61..6371dfb263 100644 --- a/wallet/test/run-wallet.c +++ b/wallet/test/run-wallet.c @@ -40,6 +40,7 @@ static void test_error(struct lightningd *ld, bool fatal, const char *fmt, va_li #include #include #include +#include /* AUTOGENERATED MOCKS START */ /* Generated stub for add_node_announcement_sig */ diff --git a/wallet/txfilter.c b/wallet/txfilter.c index 10ef774e41..b96228611f 100644 --- a/wallet/txfilter.c +++ b/wallet/txfilter.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include diff --git a/wallet/wallet.h b/wallet/wallet.h index f956196b37..7eb1a51c0f 100644 --- a/wallet/wallet.h +++ b/wallet/wallet.h @@ -18,6 +18,7 @@ #include struct amount_msat; +struct bitcoin_signature; struct invoices; struct channel; struct channel_inflight; diff --git a/wire/Makefile b/wire/Makefile index d695f1a493..6d10c3e6b9 100644 --- a/wire/Makefile +++ b/wire/Makefile @@ -74,6 +74,8 @@ wire/peer_wiregen.h_args := --include='common/channel_id.h' --include='bitcoin/t wire/peer_wiregen.c_args := -s --expose-tlv-type=tlv_n1 --expose-tlv-type=tlv_n2 +wire/peer_printgen.c_args := --include='wire/peer_wiregen.h' + # The payload isn't parsed in a fromwire, so we need to expose it. wire/onion_wiregen.h_args := --include='bitcoin/short_channel_id.h' --include='bitcoin/privkey.h' --include='common/bigsize.h' --include='common/amount.h' --include='common/node_id.h' --include='bitcoin/block.h' --include='common/sciddir_or_pubkey.h' -s --expose-tlv-type=tlv_payload @@ -86,8 +88,8 @@ wire/peer_exp_printgen.h_args := --include='wire/channel_type_printgen.h' wire/onion_exp_wiregen.h_args := $(wire/onion_wiregen.h_args) wire/onion_exp_wiregen.c_args := $(wire/onion_wiregen.c_args) -wire/bolt12_wiregen.c_args := -s --expose-tlv-type=tlv_blinded_path --expose-tlv-type=tlv_invoice_request --expose-tlv-type=tlv_invoice -wire/bolt12_wiregen.h_args := --include='bitcoin/short_channel_id.h' --include='bitcoin/signature.h' --include='bitcoin/privkey.h' --include='common/bigsize.h' --include='common/amount.h' --include='common/node_id.h' --include='bitcoin/block.h' --include='wire/onion_wire.h' $(wire/bolt12_wiregen.c_args) +wire/bolt12_wiregen.c_args := -s --expose-tlv-type=tlv_blinded_path --expose-tlv-type=tlv_invoice_request --expose-tlv-type=tlv_invoice --include='wire/onion_wiregen.h' +wire/bolt12_wiregen.h_args := --include='bitcoin/short_channel_id.h' --include='bitcoin/signature.h' --include='bitcoin/privkey.h' --include='common/bigsize.h' --include='common/amount.h' --include='common/node_id.h' --include='bitcoin/block.h' $(wire/bolt12_wiregen.c_args) wire/bolt12_printgen.c_args := --expose-tlv-type=tlv_blinded_path --expose-tlv-type=tlv_invoice_request --include='wire/onion_wiregen.h' --include='wire/onion_printgen.h' wire/bolt12_printgen.h_args := --include='wire/bolt12_wiregen.h' --expose-tlv-type=tlv_blinded_path --expose-tlv-type=tlv_invoice_request diff --git a/wire/onion_defs.h b/wire/onion_defs.h index cdfc0b3b8d..312636f798 100644 --- a/wire/onion_defs.h +++ b/wire/onion_defs.h @@ -2,7 +2,6 @@ #ifndef LIGHTNING_WIRE_ONION_DEFS_H #define LIGHTNING_WIRE_ONION_DEFS_H #include "config.h" -#include /* BOLT #4: * diff --git a/wire/onion_wire.h b/wire/onion_wire.h deleted file mode 100644 index 54947d4db8..0000000000 --- a/wire/onion_wire.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef LIGHTNING_WIRE_ONION_WIRE_H -#define LIGHTNING_WIRE_ONION_WIRE_H -#include "config.h" -#include - -#include - -#endif /* LIGHTNING_WIRE_ONION_WIRE_H */ diff --git a/wire/peer_wire.h b/wire/peer_wire.h index 2097a3c9d5..760e062302 100644 --- a/wire/peer_wire.h +++ b/wire/peer_wire.h @@ -1,7 +1,6 @@ #ifndef LIGHTNING_WIRE_PEER_WIRE_H #define LIGHTNING_WIRE_PEER_WIRE_H #include "config.h" -#include #include diff --git a/wire/tlvstream.c b/wire/tlvstream.c index 9e1c774261..8afb7f2b49 100644 --- a/wire/tlvstream.c +++ b/wire/tlvstream.c @@ -1,6 +1,7 @@ #include "config.h" #include #include +#include #include #include diff --git a/wire/tlvstream.h b/wire/tlvstream.h index 090ba4e214..a8a76e340e 100644 --- a/wire/tlvstream.h +++ b/wire/tlvstream.h @@ -2,8 +2,6 @@ #define LIGHTNING_WIRE_TLVSTREAM_H #include "config.h" #include -#include -#include struct tlv_record_type { u64 type; diff --git a/wire/wire.h b/wire/wire.h index 548f5b0741..8e8f12ac61 100644 --- a/wire/wire.h +++ b/wire/wire.h @@ -1,12 +1,9 @@ #ifndef LIGHTNING_WIRE_WIRE_H #define LIGHTNING_WIRE_WIRE_H #include "config.h" -#include -#include #include #include #include -#include struct ripemd160; struct sha256;