Skip to content

Commit f6a4e79

Browse files
committed
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 <[email protected]>
1 parent 65d9978 commit f6a4e79

File tree

212 files changed

+178
-153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

212 files changed

+178
-153
lines changed

bitcoin/block.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include "bitcoin/shadouble.h"
55
#include <ccan/endian/endian.h>
66
#include <ccan/structeq/structeq.h>
7-
#include <ccan/tal/tal.h>
87

98
struct chainparams;
109

bitcoin/feerate.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#define LIGHTNING_BITCOIN_FEERATE_H
33
#include "config.h"
44
#include <ccan/build_assert/build_assert.h>
5-
#include <ccan/short_types/short_types.h>
65
#include <common/amount.h>
76

87
/* bitcoind considers 250 satoshi per kw to be the minimum acceptable fee:

bitcoin/privkey.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#define LIGHTNING_BITCOIN_PRIVKEY_H
33
#include "config.h"
44
#include <ccan/short_types/short_types.h>
5-
#include <ccan/structeq/structeq.h>
65
#include <ccan/tal/tal.h>
76

87
#define PRIVKEY_LEN 32

bitcoin/script.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <ccan/mem/mem.h>
1010
#include <common/utils.h>
1111
#include <sodium/randombytes.h>
12+
#include <wally_script.h>
1213

1314
/* To push 0-75 bytes onto stack. */
1415
#define OP_PUSHBYTES(val) (val)

bitcoin/script.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include "config.h"
44
#include "signature.h"
55
#include "tx.h"
6-
#include <wally_script.h>
76

87
struct bitcoin_address;
98
struct preimage;

bitcoin/short_channel_id.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#ifndef LIGHTNING_BITCOIN_SHORT_CHANNEL_ID_H
22
#define LIGHTNING_BITCOIN_SHORT_CHANNEL_ID_H
33
#include "config.h"
4-
#include <ccan/compiler/compiler.h>
54
#include <ccan/short_types/short_types.h>
65
#include <ccan/tal/tal.h>
76
#include <common/gossip_constants.h>

bitcoin/tx.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
#define LIGHTNING_BITCOIN_TX_H
33
#include "config.h"
44
#include <bitcoin/chainparams.h>
5-
#include <bitcoin/shadouble.h>
6-
#include <bitcoin/signature.h>
75
#include <bitcoin/varint.h>
8-
#include <ccan/structeq/structeq.h>
9-
#include <common/amount.h>
106
#include <wally_transaction.h>
117

128
#define BITCOIN_TX_DEFAULT_SEQUENCE 0xFFFFFFFF

channeld/channeld.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@
4242
#include <common/status.h>
4343
#include <common/subdaemon.h>
4444
#include <common/timeout.h>
45+
#include <common/utils.h>
4546
#include <common/wire_error.h>
4647
#include <errno.h>
4748
#include <fcntl.h>
4849
#include <hsmd/hsmd_wiregen.h>
50+
#include <inttypes.h>
4951
#include <stdio.h>
5052
#include <wally_bip32.h>
5153
#include <wire/peer_wire.h>

channeld/channeld.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#define LIGHTNING_CHANNELD_CHANNELD_H
33
#include "config.h"
44
#include <ccan/short_types/short_types.h>
5-
#include <ccan/take/take.h>
65
#include <ccan/tal/tal.h>
76

87
const u8 *hsm_req(const tal_t *ctx, const u8 *req TAKES);

channeld/channeld_htlc.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
#ifndef LIGHTNING_CHANNELD_CHANNELD_HTLC_H
22
#define LIGHTNING_CHANNELD_CHANNELD_HTLC_H
33
#include "config.h"
4-
#include <ccan/crypto/siphash24/siphash24.h>
54
#include <common/htlc.h>
65
#include <common/pseudorand.h>
7-
#include <wire/onion_wire.h>
8-
#include <wire/tlvstream.h>
96

107
struct htlc {
118
/* What's the status. */

0 commit comments

Comments
 (0)