mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-23 17:14:22 +01:00
Move gossip_constants.h into common/
Turns out we weren't checking the BOLT comments before, so they needed an overhaul. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -29,6 +29,7 @@
|
|||||||
#include <common/crypto_sync.h>
|
#include <common/crypto_sync.h>
|
||||||
#include <common/dev_disconnect.h>
|
#include <common/dev_disconnect.h>
|
||||||
#include <common/features.h>
|
#include <common/features.h>
|
||||||
|
#include <common/gossip_constants.h>
|
||||||
#include <common/gossip_store.h>
|
#include <common/gossip_store.h>
|
||||||
#include <common/htlc_tx.h>
|
#include <common/htlc_tx.h>
|
||||||
#include <common/key_derive.h>
|
#include <common/key_derive.h>
|
||||||
@@ -49,7 +50,6 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <gossipd/gen_gossip_peerd_wire.h>
|
#include <gossipd/gen_gossip_peerd_wire.h>
|
||||||
#include <gossipd/gossip_constants.h>
|
|
||||||
#include <hsmd/gen_hsm_wire.h>
|
#include <hsmd/gen_hsm_wire.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <secp256k1.h>
|
#include <secp256k1.h>
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ COMMON_SRC_NOGEN := \
|
|||||||
|
|
||||||
COMMON_SRC_GEN := common/gen_status_wire.c common/gen_peer_status_wire.c
|
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_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)
|
COMMON_HEADERS := $(COMMON_HEADERS_GEN) $(COMMON_HEADERS_NOGEN)
|
||||||
|
|||||||
@@ -1,22 +1,18 @@
|
|||||||
#ifndef LIGHTNING_GOSSIPD_GOSSIP_CONSTANTS_H
|
#ifndef LIGHTNING_COMMON_GOSSIP_CONSTANTS_H
|
||||||
#define LIGHTNING_GOSSIPD_GOSSIP_CONSTANTS_H
|
#define LIGHTNING_COMMON_GOSSIP_CONSTANTS_H
|
||||||
|
#include "config.h"
|
||||||
#include <common/utils.h>
|
#include <common/utils.h>
|
||||||
|
|
||||||
/* BOLT #4:
|
/* BOLT #4:
|
||||||
*
|
*
|
||||||
* - Length: the maximum route length is limited to 20 hops.
|
* - a 1300-byte `hop_payloads` consisting of multiple, variable length,
|
||||||
*...
|
* `hop_payload` payloads or up to 20 fixed sized legacy `hop_data` payloads.
|
||||||
* 1. type: `onion_packet`
|
|
||||||
* 2. data:
|
|
||||||
* * [`byte`:`version`]
|
|
||||||
* * [`point`:`public_key`]
|
|
||||||
* * [`1300*byte`:`hops_data`]
|
|
||||||
*/
|
*/
|
||||||
#define ROUTING_MAX_HOPS 20
|
#define ROUTING_MAX_HOPS 20
|
||||||
|
|
||||||
/* BOLT #7:
|
/* BOLT #7:
|
||||||
*
|
*
|
||||||
* The `flags` bitfield...individual bits:
|
* The `channel_flags` bitfield...individual bits:
|
||||||
*...
|
*...
|
||||||
* | 0 | `direction` | Direction this update refers to. |
|
* | 0 | `direction` | Direction this update refers to. |
|
||||||
* | 1 | `disable` | Disable the channel. |
|
* | 1 | `disable` | Disable the channel. |
|
||||||
@@ -29,7 +25,7 @@
|
|||||||
* The `message_flags` bitfield is used to indicate the presence of optional
|
* The `message_flags` bitfield is used to indicate the presence of optional
|
||||||
* fields in the `channel_update` message:
|
* fields in the `channel_update` message:
|
||||||
* | Bit Position | Name | Field |
|
* | Bit Position | Name | Field |
|
||||||
* | ------------- | ------------------------- | -------------------- |
|
* | ------------- | ------------------------- | ----------------...- |
|
||||||
* | 0 | `option_channel_htlc_max` | `htlc_maximum_msat` |
|
* | 0 | `option_channel_htlc_max` | `htlc_maximum_msat` |
|
||||||
*/
|
*/
|
||||||
#define ROUTING_OPT_HTLC_MAX_MSAT (1 << 0)
|
#define ROUTING_OPT_HTLC_MAX_MSAT (1 << 0)
|
||||||
@@ -37,7 +33,8 @@
|
|||||||
/* BOLT #7:
|
/* BOLT #7:
|
||||||
*
|
*
|
||||||
* - MUST NOT send `announcement_signatures` messages until `funding_locked`
|
* - 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
|
#define ANNOUNCE_MIN_DEPTH 6
|
||||||
|
|
||||||
@@ -81,4 +78,4 @@
|
|||||||
#define GOSSIP_TOKEN_TIME(dev_fast_gossip_flag) \
|
#define GOSSIP_TOKEN_TIME(dev_fast_gossip_flag) \
|
||||||
DEV_FAST_GOSSIP(dev_fast_gossip_flag, 1, 3600)
|
DEV_FAST_GOSSIP(dev_fast_gossip_flag, 1, 3600)
|
||||||
|
|
||||||
#endif /* LIGHTNING_GOSSIPD_GOSSIP_CONSTANTS_H */
|
#endif /* LIGHTNING_COMMON_GOSSIP_CONSTANTS_H */
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ccan/fdpass/fdpass.h>
|
#include <ccan/fdpass/fdpass.h>
|
||||||
|
#include <common/gossip_constants.h>
|
||||||
#include <common/gossip_rcvd_filter.h>
|
#include <common/gossip_rcvd_filter.h>
|
||||||
#include <common/per_peer_state.h>
|
#include <common/per_peer_state.h>
|
||||||
#include <gossipd/gossip_constants.h>
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <wire/wire.h>
|
#include <wire/wire.h>
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
#include <ccan/crc32c/crc32c.h>
|
#include <ccan/crc32c/crc32c.h>
|
||||||
#include <ccan/err/err.h>
|
#include <ccan/err/err.h>
|
||||||
#include <ccan/str/hex/hex.h>
|
#include <ccan/str/hex/hex.h>
|
||||||
|
#include <common/gossip_constants.h>
|
||||||
#include <common/utils.h>
|
#include <common/utils.h>
|
||||||
#include <gossipd/gossip_constants.h>
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <wire/gen_peer_wire.h>
|
#include <wire/gen_peer_wire.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ gossipd-wrongdir:
|
|||||||
default: gossipd-all
|
default: gossipd-all
|
||||||
|
|
||||||
# lightningd uses this:
|
# 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_SRC := gossipd/gen_gossip_wire.c
|
||||||
LIGHTNINGD_GOSSIP_CONTROL_OBJS := $(LIGHTNINGD_GOSSIP_CONTROL_SRC:.c=.o)
|
LIGHTNINGD_GOSSIP_CONTROL_OBJS := $(LIGHTNINGD_GOSSIP_CONTROL_SRC:.c=.o)
|
||||||
|
|
||||||
|
|||||||
@@ -7,9 +7,9 @@
|
|||||||
#include <ccan/intmap/intmap.h>
|
#include <ccan/intmap/intmap.h>
|
||||||
#include <ccan/time/time.h>
|
#include <ccan/time/time.h>
|
||||||
#include <common/amount.h>
|
#include <common/amount.h>
|
||||||
|
#include <common/gossip_constants.h>
|
||||||
#include <common/node_id.h>
|
#include <common/node_id.h>
|
||||||
#include <gossipd/broadcast.h>
|
#include <gossipd/broadcast.h>
|
||||||
#include <gossipd/gossip_constants.h>
|
|
||||||
#include <gossipd/gossip_store.h>
|
#include <gossipd/gossip_store.h>
|
||||||
#include <wire/gen_onion_wire.h>
|
#include <wire/gen_onion_wire.h>
|
||||||
#include <wire/wire.h>
|
#include <wire/wire.h>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#include <ccan/cast/cast.h>
|
#include <ccan/cast/cast.h>
|
||||||
#include <channeld/gen_channel_wire.h>
|
#include <channeld/gen_channel_wire.h>
|
||||||
#include <common/features.h>
|
#include <common/features.h>
|
||||||
|
#include <common/gossip_constants.h>
|
||||||
#include <common/json_command.h>
|
#include <common/json_command.h>
|
||||||
#include <common/jsonrpc_errors.h>
|
#include <common/jsonrpc_errors.h>
|
||||||
#include <common/memleak.h>
|
#include <common/memleak.h>
|
||||||
@@ -12,7 +13,6 @@
|
|||||||
#include <common/wallet_tx.h>
|
#include <common/wallet_tx.h>
|
||||||
#include <common/wire_error.h>
|
#include <common/wire_error.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <gossipd/gossip_constants.h>
|
|
||||||
#include <hsmd/gen_hsm_wire.h>
|
#include <hsmd/gen_hsm_wire.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <lightningd/channel_control.h>
|
#include <lightningd/channel_control.h>
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
#include <ccan/tal/str/str.h>
|
#include <ccan/tal/str/str.h>
|
||||||
#include <common/amount.h>
|
#include <common/amount.h>
|
||||||
#include <common/bolt11.h>
|
#include <common/bolt11.h>
|
||||||
|
#include <common/gossip_constants.h>
|
||||||
#include <common/pseudorand.h>
|
#include <common/pseudorand.h>
|
||||||
#include <common/type_to_string.h>
|
#include <common/type_to_string.h>
|
||||||
#include <gossipd/gossip_constants.h>
|
|
||||||
#include <plugins/libplugin.h>
|
#include <plugins/libplugin.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <wire/onion_defs.h>
|
#include <wire/onion_defs.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user