Skip to content

Commit

Permalink
common/bolt12: include correct bolt12 wiregen header.
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
rustyrussell authored and cdecker committed Jan 13, 2021
1 parent 6dab04e commit a4bc3e5
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 21 deletions.
4 changes: 1 addition & 3 deletions channeld/channeld.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <channeld/watchtower.h>
#include <common/billboard.h>
#include <common/blinding.h>
#include <common/bolt12.h>
#include <common/coin_mvt.h>
#include <common/crypto_sync.h>
#include <common/dev_disconnect.h>
Expand Down Expand Up @@ -65,9 +66,6 @@
#include <inttypes.h>
#include <secp256k1.h>
#include <stdio.h>
#if EXPERIMENTAL_FEATURES
#include <wire/bolt12_exp_wiregen.h>
#endif
#include <wire/common_wiregen.h>
#include <wire/onion_wire.h>
#include <wire/peer_wire.h>
Expand Down
6 changes: 1 addition & 5 deletions common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand Down
4 changes: 4 additions & 0 deletions common/bolt12.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#ifndef LIGHTNING_COMMON_BOLT12_H
#define LIGHTNING_COMMON_BOLT12_H
#include "config.h"
#if EXPERIMENTAL_FEATURES
#include <wire/bolt12_exp_wiregen.h>
#else
#include <wire/bolt12_wiregen.h>
#endif

struct feature_set;

Expand Down
2 changes: 1 addition & 1 deletion common/bolt12_merkle.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef LIGHTNING_COMMON_BOLT12_MERKLE_H
#define LIGHTNING_COMMON_BOLT12_MERKLE_H
#include "config.h"
#include <wire/bolt12_exp_wiregen.h>
#include <common/bolt12.h>

/**
* merkle_tlv - bolt12-style merkle hash of this tlv minus signature fields
Expand Down
2 changes: 1 addition & 1 deletion devtools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 0 additions & 3 deletions gossipd/gossipd.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@
#include <sys/types.h>
#include <sys/un.h>
#include <unistd.h>
#if EXPERIMENTAL_FEATURES
#include <wire/bolt12_exp_wiregen.h>
#endif
#include <wire/wire_io.h>
#include <wire/wire_sync.h>

Expand Down
2 changes: 1 addition & 1 deletion plugins/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions wire/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -21,18 +22,14 @@ 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

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)
Expand Down
2 changes: 1 addition & 1 deletion wire/common_wiregen.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion wire/common_wiregen.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a4bc3e5

Please sign in to comment.