Skip to content

Commit a4bc3e5

Browse files
rustyrussellcdecker
authored andcommitted
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 <[email protected]>
1 parent 6dab04e commit a4bc3e5

File tree

10 files changed

+13
-21
lines changed

10 files changed

+13
-21
lines changed

channeld/channeld.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <channeld/watchtower.h>
3333
#include <common/billboard.h>
3434
#include <common/blinding.h>
35+
#include <common/bolt12.h>
3536
#include <common/coin_mvt.h>
3637
#include <common/crypto_sync.h>
3738
#include <common/dev_disconnect.h>
@@ -65,9 +66,6 @@
6566
#include <inttypes.h>
6667
#include <secp256k1.h>
6768
#include <stdio.h>
68-
#if EXPERIMENTAL_FEATURES
69-
#include <wire/bolt12_exp_wiregen.h>
70-
#endif
7169
#include <wire/common_wiregen.h>
7270
#include <wire/onion_wire.h>
7371
#include <wire/peer_wire.h>

common/Makefile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ COMMON_SRC_NOGEN := \
1212
common/bolt11.c \
1313
common/bolt11_json.c \
1414
common/bolt12.c \
15+
common/bolt12_merkle.c \
1516
common/channel_config.c \
1617
common/channel_id.c \
1718
common/coin_mvt.c \
@@ -91,11 +92,6 @@ endif
9192

9293
COMMON_SRC_GEN := common/status_wiregen.c common/peer_status_wiregen.c
9394

94-
ifeq ($(EXPERIMENTAL_FEATURES),1)
95-
COMMON_SRC_NOGEN += common/bolt12.c
96-
COMMON_SRC_NOGEN += common/bolt12_merkle.c
97-
endif
98-
9995
COMMON_HEADERS_NOGEN := $(COMMON_SRC_NOGEN:.c=.h) \
10096
common/closing_fee.h \
10197
common/ecdh.h \

common/bolt12.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#ifndef LIGHTNING_COMMON_BOLT12_H
22
#define LIGHTNING_COMMON_BOLT12_H
33
#include "config.h"
4+
#if EXPERIMENTAL_FEATURES
45
#include <wire/bolt12_exp_wiregen.h>
6+
#else
7+
#include <wire/bolt12_wiregen.h>
8+
#endif
59

610
struct feature_set;
711

common/bolt12_merkle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef LIGHTNING_COMMON_BOLT12_MERKLE_H
22
#define LIGHTNING_COMMON_BOLT12_MERKLE_H
33
#include "config.h"
4-
#include <wire/bolt12_exp_wiregen.h>
4+
#include <common/bolt12.h>
55

66
/**
77
* merkle_tlv - bolt12-style merkle hash of this tlv minus signature fields

devtools/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ DEVTOOLS_COMMON_OBJS := \
4949

5050
devtools/bolt11-cli: $(DEVTOOLS_COMMON_OBJS) $(JSMN_OBJS) $(CCAN_OBJS) $(BITCOIN_OBJS) wire/fromwire.o wire/towire.o devtools/bolt11-cli.o
5151

52-
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
52+
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
5353

5454
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
5555

gossipd/gossipd.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,6 @@
6868
#include <sys/types.h>
6969
#include <sys/un.h>
7070
#include <unistd.h>
71-
#if EXPERIMENTAL_FEATURES
72-
#include <wire/bolt12_exp_wiregen.h>
73-
#endif
7471
#include <wire/wire_io.h>
7572
#include <wire/wire_sync.h>
7673

plugins/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ PLUGIN_PAY_SRC := plugins/pay.c
22
PLUGIN_PAY_OBJS := $(PLUGIN_PAY_SRC:.c=.o)
33

44
ifeq ($(EXPERIMENTAL_FEATURES),1)
5-
PLUGIN_PAY_EXPERIMENTAL_OBJS := common/bolt12.o common/bolt12_merkle.o wire/bolt12_exp_wiregen.o bitcoin/block.o
5+
PLUGIN_PAY_EXPERIMENTAL_OBJS := common/bolt12.o common/bolt12_merkle.o wire/bolt12$(EXP)_wiregen.o bitcoin/block.o
66
endif
77

88
PLUGIN_AUTOCLEAN_SRC := plugins/autoclean.c

wire/Makefile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ WIRE_HEADERS := wire/onion_defs.h \
99
wire/wire_io.h \
1010
wire/peer$(EXP)_wiregen.h \
1111
wire/onion$(EXP)_wiregen.h \
12+
wire/bolt12$(EXP)_wiregen.h \
1213
wire/common_wiregen.h \
1314
wire/peer$(EXP)_printgen.h \
1415
wire/onion$(EXP)_printgen.h
@@ -21,18 +22,14 @@ WIRE_SRC := wire/wire_sync.c \
2122
wire/tlvstream.c \
2223
wire/towire.c \
2324
wire/common_wiregen.c \
25+
wire/bolt12$(EXP)_wiregen.c \
2426
wire/peer$(EXP)_wiregen.c \
2527
wire/onion$(EXP)_wiregen.c
2628

2729
WIRE_PRINT_SRC := \
2830
wire/onion$(EXP)_printgen.c \
2931
wire/peer$(EXP)_printgen.c
3032

31-
ifeq ($(EXPERIMENTAL_FEATURES),1)
32-
WIRE_HEADERS += wire/bolt12$(EXP)_wiregen.h
33-
WIRE_SRC += wire/bolt12$(EXP)_wiregen.c
34-
endif
35-
3633
WIRE_OBJS := $(WIRE_SRC:.c=.o)
3734
WIRE_PRINT_OBJS := $(WIRE_PRINT_SRC:.c=.o)
3835
$(WIRE_OBJS) $(WIRE_PRINT_OBJS): $(WIRE_HEADERS)

wire/common_wiregen.c

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wire/common_wiregen.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)