From a4bc3e5673c7edd1dc69e6654187a531a6738dc5 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 13 Jan 2021 13:30:24 +1030 Subject: [PATCH] common/bolt12: include correct bolt12 wiregen header. Don't include exp directly, use an ifdef in common/bolt12 (like we do for peer and onion wiregen files). Signed-off-by: Rusty Russell --- channeld/channeld.c | 4 +--- common/Makefile | 6 +----- common/bolt12.h | 4 ++++ common/bolt12_merkle.h | 2 +- devtools/Makefile | 2 +- gossipd/gossipd.c | 3 --- plugins/Makefile | 2 +- wire/Makefile | 7 ++----- wire/common_wiregen.c | 2 +- wire/common_wiregen.h | 2 +- 10 files changed, 13 insertions(+), 21 deletions(-) diff --git a/channeld/channeld.c b/channeld/channeld.c index 3e86da27ffec..554919fa254e 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -65,9 +66,6 @@ #include #include #include -#if EXPERIMENTAL_FEATURES -#include -#endif #include #include #include diff --git a/common/Makefile b/common/Makefile index 1f296ec43b5f..ab7a83e6400e 100644 --- a/common/Makefile +++ b/common/Makefile @@ -12,6 +12,7 @@ COMMON_SRC_NOGEN := \ common/bolt11.c \ common/bolt11_json.c \ common/bolt12.c \ + common/bolt12_merkle.c \ common/channel_config.c \ common/channel_id.c \ common/coin_mvt.c \ @@ -91,11 +92,6 @@ endif COMMON_SRC_GEN := common/status_wiregen.c common/peer_status_wiregen.c -ifeq ($(EXPERIMENTAL_FEATURES),1) -COMMON_SRC_NOGEN += common/bolt12.c -COMMON_SRC_NOGEN += common/bolt12_merkle.c -endif - COMMON_HEADERS_NOGEN := $(COMMON_SRC_NOGEN:.c=.h) \ common/closing_fee.h \ common/ecdh.h \ diff --git a/common/bolt12.h b/common/bolt12.h index 15d8e52f036a..797c5b64bdf9 100644 --- a/common/bolt12.h +++ b/common/bolt12.h @@ -1,7 +1,11 @@ #ifndef LIGHTNING_COMMON_BOLT12_H #define LIGHTNING_COMMON_BOLT12_H #include "config.h" +#if EXPERIMENTAL_FEATURES #include +#else +#include +#endif struct feature_set; diff --git a/common/bolt12_merkle.h b/common/bolt12_merkle.h index b7ff27f8c162..af8b4bad369c 100644 --- a/common/bolt12_merkle.h +++ b/common/bolt12_merkle.h @@ -1,7 +1,7 @@ #ifndef LIGHTNING_COMMON_BOLT12_MERKLE_H #define LIGHTNING_COMMON_BOLT12_MERKLE_H #include "config.h" -#include +#include /** * merkle_tlv - bolt12-style merkle hash of this tlv minus signature fields diff --git a/devtools/Makefile b/devtools/Makefile index 28bc6ab17821..bc505c76bf10 100644 --- a/devtools/Makefile +++ b/devtools/Makefile @@ -49,7 +49,7 @@ DEVTOOLS_COMMON_OBJS := \ devtools/bolt11-cli: $(DEVTOOLS_COMMON_OBJS) $(JSMN_OBJS) $(CCAN_OBJS) $(BITCOIN_OBJS) wire/fromwire.o wire/towire.o devtools/bolt11-cli.o -devtools/bolt12-cli: $(DEVTOOLS_COMMON_OBJS) $(CCAN_OBJS) $(BITCOIN_OBJS) wire/bolt12_exp_wiregen.o wire/fromwire.o wire/towire.o common/bolt12.o common/bolt12_merkle.o devtools/bolt12-cli.o common/setup.o common/iso4217.o +devtools/bolt12-cli: $(DEVTOOLS_COMMON_OBJS) $(CCAN_OBJS) $(BITCOIN_OBJS) wire/bolt12$(EXP)_wiregen.o wire/fromwire.o wire/towire.o common/bolt12.o common/bolt12_merkle.o devtools/bolt12-cli.o common/setup.o common/iso4217.o devtools/decodemsg: $(DEVTOOLS_COMMON_OBJS) $(JSMN_OBJS) $(CCAN_OBJS) $(BITCOIN_OBJS) $(WIRE_PRINT_OBJS) wire/fromwire.o wire/towire.o devtools/print_wire.o devtools/decodemsg.o diff --git a/gossipd/gossipd.c b/gossipd/gossipd.c index 7e351efa8c2b..d6906ff41830 100644 --- a/gossipd/gossipd.c +++ b/gossipd/gossipd.c @@ -68,9 +68,6 @@ #include #include #include -#if EXPERIMENTAL_FEATURES -#include -#endif #include #include diff --git a/plugins/Makefile b/plugins/Makefile index 63c152e3fcd2..de7ff5155a64 100644 --- a/plugins/Makefile +++ b/plugins/Makefile @@ -2,7 +2,7 @@ PLUGIN_PAY_SRC := plugins/pay.c PLUGIN_PAY_OBJS := $(PLUGIN_PAY_SRC:.c=.o) ifeq ($(EXPERIMENTAL_FEATURES),1) -PLUGIN_PAY_EXPERIMENTAL_OBJS := common/bolt12.o common/bolt12_merkle.o wire/bolt12_exp_wiregen.o bitcoin/block.o +PLUGIN_PAY_EXPERIMENTAL_OBJS := common/bolt12.o common/bolt12_merkle.o wire/bolt12$(EXP)_wiregen.o bitcoin/block.o endif PLUGIN_AUTOCLEAN_SRC := plugins/autoclean.c diff --git a/wire/Makefile b/wire/Makefile index 6d7bbebc2cc0..a38988de8326 100644 --- a/wire/Makefile +++ b/wire/Makefile @@ -9,6 +9,7 @@ WIRE_HEADERS := wire/onion_defs.h \ wire/wire_io.h \ wire/peer$(EXP)_wiregen.h \ wire/onion$(EXP)_wiregen.h \ + wire/bolt12$(EXP)_wiregen.h \ wire/common_wiregen.h \ wire/peer$(EXP)_printgen.h \ wire/onion$(EXP)_printgen.h @@ -21,6 +22,7 @@ WIRE_SRC := wire/wire_sync.c \ wire/tlvstream.c \ wire/towire.c \ wire/common_wiregen.c \ + wire/bolt12$(EXP)_wiregen.c \ wire/peer$(EXP)_wiregen.c \ wire/onion$(EXP)_wiregen.c @@ -28,11 +30,6 @@ WIRE_PRINT_SRC := \ wire/onion$(EXP)_printgen.c \ wire/peer$(EXP)_printgen.c -ifeq ($(EXPERIMENTAL_FEATURES),1) -WIRE_HEADERS += wire/bolt12$(EXP)_wiregen.h -WIRE_SRC += wire/bolt12$(EXP)_wiregen.c -endif - WIRE_OBJS := $(WIRE_SRC:.c=.o) WIRE_PRINT_OBJS := $(WIRE_PRINT_SRC:.c=.o) $(WIRE_OBJS) $(WIRE_PRINT_OBJS): $(WIRE_HEADERS) diff --git a/wire/common_wiregen.c b/wire/common_wiregen.c index 1020bf324c82..7dea9032eb45 100644 --- a/wire/common_wiregen.c +++ b/wire/common_wiregen.c @@ -100,4 +100,4 @@ bool fromwire_custommsg_out(const tal_t *ctx, const void *p, u8 **msg) fromwire_u8_array(&cursor, &plen, *msg, msg_len); return cursor != NULL; } -// SHA256STAMP:c7bc8e19dcbad6f504b8dfb8e1f1d2bc49d86782ef8ba869413461fe5c77faec +// SHA256STAMP:c97dcd31559f7a0764d6bad2a532cbe79355b4c7c17b32f60ceb810329959865 diff --git a/wire/common_wiregen.h b/wire/common_wiregen.h index 9609b457dbf4..95cb040f1c07 100644 --- a/wire/common_wiregen.h +++ b/wire/common_wiregen.h @@ -41,4 +41,4 @@ bool fromwire_custommsg_out(const tal_t *ctx, const void *p, u8 **msg); #endif /* LIGHTNING_WIRE_COMMON_WIREGEN_H */ -// SHA256STAMP:c7bc8e19dcbad6f504b8dfb8e1f1d2bc49d86782ef8ba869413461fe5c77faec +// SHA256STAMP:c97dcd31559f7a0764d6bad2a532cbe79355b4c7c17b32f60ceb810329959865