diff --git a/channeld/channeld.c b/channeld/channeld.c index ccf4325cf..f6b788f31 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -49,7 +50,6 @@ #include #include #include -#include #include #include #include diff --git a/common/Makefile b/common/Makefile index e817a2e7d..e9dd1d4e7 100644 --- a/common/Makefile +++ b/common/Makefile @@ -64,7 +64,7 @@ COMMON_SRC_NOGEN := \ COMMON_SRC_GEN := common/gen_status_wire.c common/gen_peer_status_wire.c -COMMON_HEADERS_NOGEN := $(COMMON_SRC_NOGEN:.c=.h) common/overflows.h common/htlc.h common/status_levels.h common/json_command.h common/jsonrpc_errors.h +COMMON_HEADERS_NOGEN := $(COMMON_SRC_NOGEN:.c=.h) common/overflows.h common/htlc.h common/status_levels.h common/json_command.h common/jsonrpc_errors.h common/gossip_constants.h COMMON_HEADERS_GEN := common/gen_htlc_state_names.h common/gen_status_wire.h common/gen_peer_status_wire.h COMMON_HEADERS := $(COMMON_HEADERS_GEN) $(COMMON_HEADERS_NOGEN) diff --git a/gossipd/gossip_constants.h b/common/gossip_constants.h similarity index 83% rename from gossipd/gossip_constants.h rename to common/gossip_constants.h index 8b7f9b681..d62ff723b 100644 --- a/gossipd/gossip_constants.h +++ b/common/gossip_constants.h @@ -1,22 +1,18 @@ -#ifndef LIGHTNING_GOSSIPD_GOSSIP_CONSTANTS_H -#define LIGHTNING_GOSSIPD_GOSSIP_CONSTANTS_H +#ifndef LIGHTNING_COMMON_GOSSIP_CONSTANTS_H +#define LIGHTNING_COMMON_GOSSIP_CONSTANTS_H +#include "config.h" #include /* BOLT #4: * - * - Length: the maximum route length is limited to 20 hops. - *... - * 1. type: `onion_packet` - * 2. data: - * * [`byte`:`version`] - * * [`point`:`public_key`] - * * [`1300*byte`:`hops_data`] + * - a 1300-byte `hop_payloads` consisting of multiple, variable length, + * `hop_payload` payloads or up to 20 fixed sized legacy `hop_data` payloads. */ #define ROUTING_MAX_HOPS 20 /* BOLT #7: * - * The `flags` bitfield...individual bits: + * The `channel_flags` bitfield...individual bits: *... * | 0 | `direction` | Direction this update refers to. | * | 1 | `disable` | Disable the channel. | @@ -29,7 +25,7 @@ * The `message_flags` bitfield is used to indicate the presence of optional * fields in the `channel_update` message: * | Bit Position | Name | Field | - * | ------------- | ------------------------- | -------------------- | + * | ------------- | ------------------------- | ----------------...- | * | 0 | `option_channel_htlc_max` | `htlc_maximum_msat` | */ #define ROUTING_OPT_HTLC_MAX_MSAT (1 << 0) @@ -37,7 +33,8 @@ /* BOLT #7: * * - MUST NOT send `announcement_signatures` messages until `funding_locked` - * has been sent AND the funding transaction has at least six confirmations. + * has been sent and received AND the funding transaction has at least six + * confirmations. */ #define ANNOUNCE_MIN_DEPTH 6 @@ -81,4 +78,4 @@ #define GOSSIP_TOKEN_TIME(dev_fast_gossip_flag) \ DEV_FAST_GOSSIP(dev_fast_gossip_flag, 1, 3600) -#endif /* LIGHTNING_GOSSIPD_GOSSIP_CONSTANTS_H */ +#endif /* LIGHTNING_COMMON_GOSSIP_CONSTANTS_H */ diff --git a/common/per_peer_state.c b/common/per_peer_state.c index 727db9d4d..b4cb680c4 100644 --- a/common/per_peer_state.c +++ b/common/per_peer_state.c @@ -1,8 +1,8 @@ #include #include +#include #include #include -#include #include #include diff --git a/devtools/mkgossip.c b/devtools/mkgossip.c index 8d62c289a..b6cf9db7b 100644 --- a/devtools/mkgossip.c +++ b/devtools/mkgossip.c @@ -15,8 +15,8 @@ #include #include #include +#include #include -#include #include #include #include diff --git a/gossipd/Makefile b/gossipd/Makefile index e2354d166..50ce42251 100644 --- a/gossipd/Makefile +++ b/gossipd/Makefile @@ -7,7 +7,7 @@ gossipd-wrongdir: default: gossipd-all # lightningd uses this: -LIGHTNINGD_GOSSIP_CONTROL_HEADERS := gossipd/gen_gossip_wire.h gossipd/gossip_constants.h +LIGHTNINGD_GOSSIP_CONTROL_HEADERS := gossipd/gen_gossip_wire.h LIGHTNINGD_GOSSIP_CONTROL_SRC := gossipd/gen_gossip_wire.c LIGHTNINGD_GOSSIP_CONTROL_OBJS := $(LIGHTNINGD_GOSSIP_CONTROL_SRC:.c=.o) diff --git a/gossipd/routing.h b/gossipd/routing.h index 779303a8b..6f69233f9 100644 --- a/gossipd/routing.h +++ b/gossipd/routing.h @@ -7,9 +7,9 @@ #include #include #include +#include #include #include -#include #include #include #include diff --git a/lightningd/channel_control.c b/lightningd/channel_control.c index 4e70f57c6..ec16713cb 100644 --- a/lightningd/channel_control.c +++ b/lightningd/channel_control.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -12,7 +13,6 @@ #include #include #include -#include #include #include #include diff --git a/plugins/pay.c b/plugins/pay.c index 122c18876..d524611e8 100644 --- a/plugins/pay.c +++ b/plugins/pay.c @@ -5,9 +5,9 @@ #include #include #include +#include #include #include -#include #include #include #include