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 <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2025-10-22 19:44:27 +10:30
parent 65d997842e
commit f6a4e79420
212 changed files with 178 additions and 153 deletions

View File

@@ -4,7 +4,6 @@
#include "bitcoin/shadouble.h"
#include <ccan/endian/endian.h>
#include <ccan/structeq/structeq.h>
#include <ccan/tal/tal.h>
struct chainparams;

View File

@@ -2,7 +2,6 @@
#define LIGHTNING_BITCOIN_FEERATE_H
#include "config.h"
#include <ccan/build_assert/build_assert.h>
#include <ccan/short_types/short_types.h>
#include <common/amount.h>
/* bitcoind considers 250 satoshi per kw to be the minimum acceptable fee:

View File

@@ -2,7 +2,6 @@
#define LIGHTNING_BITCOIN_PRIVKEY_H
#include "config.h"
#include <ccan/short_types/short_types.h>
#include <ccan/structeq/structeq.h>
#include <ccan/tal/tal.h>
#define PRIVKEY_LEN 32

View File

@@ -9,6 +9,7 @@
#include <ccan/mem/mem.h>
#include <common/utils.h>
#include <sodium/randombytes.h>
#include <wally_script.h>
/* To push 0-75 bytes onto stack. */
#define OP_PUSHBYTES(val) (val)

View File

@@ -3,7 +3,6 @@
#include "config.h"
#include "signature.h"
#include "tx.h"
#include <wally_script.h>
struct bitcoin_address;
struct preimage;

View File

@@ -1,7 +1,6 @@
#ifndef LIGHTNING_BITCOIN_SHORT_CHANNEL_ID_H
#define LIGHTNING_BITCOIN_SHORT_CHANNEL_ID_H
#include "config.h"
#include <ccan/compiler/compiler.h>
#include <ccan/short_types/short_types.h>
#include <ccan/tal/tal.h>
#include <common/gossip_constants.h>

View File

@@ -2,11 +2,7 @@
#define LIGHTNING_BITCOIN_TX_H
#include "config.h"
#include <bitcoin/chainparams.h>
#include <bitcoin/shadouble.h>
#include <bitcoin/signature.h>
#include <bitcoin/varint.h>
#include <ccan/structeq/structeq.h>
#include <common/amount.h>
#include <wally_transaction.h>
#define BITCOIN_TX_DEFAULT_SEQUENCE 0xFFFFFFFF