Skip to content

Commit

Permalink
common/wireaddr: don't include lightningd/lightningd.
Browse files Browse the repository at this point in the history
common should not include specific per-daemon files.  Turns out this
caused a lot of indirect includes to be exposed.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Feb 27, 2020
1 parent 8f87579 commit 684ed42
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 1 deletion.
4 changes: 4 additions & 0 deletions common/json.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
#include <bitcoin/preimage.h>
#include <bitcoin/privkey.h>
#include <bitcoin/pubkey.h>
#include <bitcoin/short_channel_id.h>
#include <bitcoin/tx.h>
#include <ccan/build_assert/build_assert.h>
#include <ccan/json_escape/json_escape.h>
#include <ccan/mem/mem.h>
#include <ccan/str/hex/hex.h>
#include <ccan/tal/str/str.h>
Expand All @@ -14,6 +17,7 @@
#include <common/json_stream.h>
#include <common/node_id.h>
#include <common/overflows.h>
#include <common/type_to_string.h>
#include <common/utils.h>
#include <common/wireaddr.h>
#include <ctype.h>
Expand Down
1 change: 0 additions & 1 deletion common/wireaddr.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include "config.h"
#include <ccan/short_types/short_types.h>
#include <ccan/tal/tal.h>
#include <lightningd/lightningd.h>
#include <stdbool.h>
#include <stdlib.h>
#include <sys/socket.h>
Expand Down
1 change: 1 addition & 0 deletions devtools/print_wire.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <bitcoin/tx.h>
#include <common/wireaddr.h>
#include <wire/gen_peer_wire.h>
#include <wire/gen_onion_wire.h>

struct tlv_print_record_type {
u64 type;
Expand Down
2 changes: 2 additions & 0 deletions gossipd/gossip_generation.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
* generation, man!" */
#include <ccan/mem/mem.h>
#include <common/memleak.h>
#include <common/status.h>
#include <common/timeout.h>
#include <common/type_to_string.h>
#include <common/utils.h>
#include <common/wireaddr.h>
#include <errno.h>
Expand Down
1 change: 1 addition & 0 deletions gossipd/test/run-bench-find_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <ccan/opt/opt.h>
#include <ccan/tal/str/str.h>
#include <ccan/time/time.h>
#include <common/json_stream.h>
#include <common/pseudorand.h>
#include <common/status.h>
#include <common/type_to_string.h>
Expand Down
1 change: 1 addition & 0 deletions gossipd/test/run-crc32_of_update.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ int unused_main(int argc, char *argv[]);
#include "../queries.c"
#include "../gossip_generation.c"
#undef main
#include <common/json_stream.h>
#include <stdio.h>

/* AUTOGENERATED MOCKS START */
Expand Down
1 change: 1 addition & 0 deletions gossipd/test/run-extended-info.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <ccan/str/hex/hex.h>
#include <common/json.h>
#include <common/json_helpers.h>
#include <common/json_stream.h>
#include <stdio.h>

#ifdef NDEBUG
Expand Down
1 change: 1 addition & 0 deletions gossipd/test/run-find_route-specific.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <common/json_stream.h>
#include <common/status.h>

#include <stdio.h>
Expand Down
1 change: 1 addition & 0 deletions gossipd/test/run-find_route.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "../routing.c"
#include "../gossip_store.c"
#include <common/json_stream.h>
#include <stdio.h>

void status_fmt(enum log_level level UNUSED,
Expand Down
1 change: 1 addition & 0 deletions gossipd/test/run-next_block_range.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "../seeker.c"
#include <ccan/err/err.h>
#include <common/json_stream.h>
#include <common/wireaddr.h>
#include <stdarg.h>
#include <stdio.h>
Expand Down
1 change: 1 addition & 0 deletions gossipd/test/run-overlong.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "../routing.c"
#include "../gossip_store.c"
#include <common/json_stream.h>
#include <stdio.h>

void status_fmt(enum log_level level UNUSED,
Expand Down
1 change: 1 addition & 0 deletions gossipd/test/run-txout_failure.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "../routing.c"
#include "../common/timeout.c"
#include <common/json_stream.h>
#include <stdio.h>

/* AUTOGENERATED MOCKS START */
Expand Down
3 changes: 3 additions & 0 deletions lightningd/signmessage.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <common/bech32.h>
#include <common/hash_u5.h>
#include <common/json_command.h>
#include <common/json_helpers.h>
#include <common/jsonrpc_errors.h>
#include <common/param.h>
Expand All @@ -8,6 +9,8 @@
#include <errno.h>
#include <gossipd/gen_gossip_wire.h>
#include <hsmd/gen_hsm_wire.h>
#include <lightningd/jsonrpc.h>
#include <lightningd/lightningd.h>
#include <lightningd/subd.h>
#include <string.h>
#include <wire/wire_sync.h>
Expand Down

0 comments on commit 684ed42

Please sign in to comment.