mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 01:43:36 +01:00
Gossip: BOLT catch, remove initial_routing_sync.
Everyone sends a gossip_timestamp_filter message these days to start gossip. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
06cf5ac841
commit
002dc60b33
2
Makefile
2
Makefile
@ -26,7 +26,7 @@ CCANDIR := ccan
|
||||
|
||||
# Where we keep the BOLT RFCs
|
||||
BOLTDIR := ../bolts/
|
||||
DEFAULT_BOLTVERSION := fce8bab931674a81a9ea895c9e9162e559e48a65
|
||||
DEFAULT_BOLTVERSION := fc687e8c7638a65c9120777025ae5ae53e4e622f
|
||||
# Can be overridden on cmdline.
|
||||
BOLTVERSION := $(DEFAULT_BOLTVERSION)
|
||||
|
||||
|
@ -31,9 +31,6 @@ static const struct feature_style feature_styles[] = {
|
||||
{ OPT_DATA_LOSS_PROTECT,
|
||||
.copy_style = { [INIT_FEATURE] = FEATURE_REPRESENT,
|
||||
[NODE_ANNOUNCE_FEATURE] = FEATURE_REPRESENT } },
|
||||
{ OPT_INITIAL_ROUTING_SYNC,
|
||||
.copy_style = { [INIT_FEATURE] = FEATURE_REPRESENT_AS_OPTIONAL,
|
||||
[NODE_ANNOUNCE_FEATURE] = FEATURE_DONT_REPRESENT } },
|
||||
{ OPT_UPFRONT_SHUTDOWN_SCRIPT,
|
||||
.copy_style = { [INIT_FEATURE] = FEATURE_REPRESENT,
|
||||
[NODE_ANNOUNCE_FEATURE] = FEATURE_REPRESENT } },
|
||||
@ -404,12 +401,6 @@ int features_unsupported(const struct feature_set *our_features,
|
||||
const u8 *their_features,
|
||||
enum feature_place p)
|
||||
{
|
||||
/* BIT 2 would logically be "compulsory initial_routing_sync", but
|
||||
* that does not exist, so we special case it. */
|
||||
if (feature_is_set(their_features,
|
||||
COMPULSORY_FEATURE(OPT_INITIAL_ROUTING_SYNC)))
|
||||
return COMPULSORY_FEATURE(OPT_INITIAL_ROUTING_SYNC);
|
||||
|
||||
return all_supported_features(our_features, their_features, p);
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,6 @@ struct feature_set *feature_set_dup(const tal_t *ctx,
|
||||
*
|
||||
* | Bits | Name |...
|
||||
* | 0/1 | `option_data_loss_protect` |... ASSUMED ...
|
||||
* | 3 | `initial_routing_sync` |... I ...
|
||||
* | 4/5 | `option_upfront_shutdown_script` |... IN ...
|
||||
* | 6/7 | `gossip_queries` |...
|
||||
* | 8/9 | `var_onion_optin` |... ASSUMED ...
|
||||
@ -123,7 +122,6 @@ struct feature_set *feature_set_dup(const tal_t *ctx,
|
||||
* | 50/51 | `option_zeroconf` | ... IN ...
|
||||
*/
|
||||
#define OPT_DATA_LOSS_PROTECT 0
|
||||
#define OPT_INITIAL_ROUTING_SYNC 2
|
||||
#define OPT_UPFRONT_SHUTDOWN_SCRIPT 4
|
||||
#define OPT_GOSSIP_QUERIES 6
|
||||
#define OPT_VAR_ONION 8
|
||||
|
@ -265,28 +265,10 @@ void setup_peer_gossip_store(struct peer *peer,
|
||||
* - MUST NOT relay any gossip messages it did not generate itself,
|
||||
* unless explicitly requested.
|
||||
*/
|
||||
if (feature_negotiated(our_features, their_features, OPT_GOSSIP_QUERIES)) {
|
||||
peer->gs.gossip_timer = NULL;
|
||||
peer->gs.active = false;
|
||||
peer->gs.off = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
peer->gs.gossip_timer = gossip_stream_timer(peer);
|
||||
peer->gs.active = !peer->daemon->dev_suppress_gossip;
|
||||
peer->gs.timestamp_min = 0;
|
||||
peer->gs.timestamp_max = UINT32_MAX;
|
||||
|
||||
/* We still respect this old bit, though spec part was removed. */
|
||||
if (feature_offered(their_features, OPT_INITIAL_ROUTING_SYNC))
|
||||
peer->gs.off = 1;
|
||||
else {
|
||||
/* During tests, particularly, we find that the gossip_store
|
||||
* moves fast, so make sure it really does start at the end. */
|
||||
peer->gs.off
|
||||
= find_gossip_store_end(peer->daemon->gossip_store_fd,
|
||||
peer->daemon->gossip_store_end);
|
||||
}
|
||||
peer->gs.gossip_timer = NULL;
|
||||
peer->gs.active = false;
|
||||
peer->gs.off = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
/* We're happy for the kernel to batch update and gossip messages, but a
|
||||
|
Loading…
Reference in New Issue
Block a user