Browse Source

More renaming of gfeatures to globalfeatures.

Use the BOLT #1 naming.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
fee-tracking2
Rusty Russell 6 years ago
parent
commit
df27fc55af
  1. 2
      common/features.h
  2. 2
      gossipd/gossip_wire.csv
  3. 6
      gossipd/gossipd.c
  4. 6
      gossipd/routing.c
  5. 2
      gossipd/routing.h

2
common/features.h

@ -5,7 +5,7 @@
#include <ccan/tal/tal.h>
/* Returns true if we're OK with all these offered features. */
bool features_supported(const u8 *gfeatures, const u8 *lfeatures);
bool features_supported(const u8 *globalfeatures, const u8 *localfeatures);
/* For sending our features: tal_count() returns length. */
u8 *get_offered_globalfeatures(const tal_t *ctx);

2
gossipd/gossip_wire.csv

@ -8,7 +8,7 @@ gossipctl_init,,broadcast_interval,u32
gossipctl_init,,chain_hash,struct bitcoin_blkid
gossipctl_init,,id,struct pubkey
gossipctl_init,,gflen,u16
gossipctl_init,,gfeatures,gflen*u8
gossipctl_init,,globalfeatures,gflen*u8
gossipctl_init,,rgb,3*u8
gossipctl_init,,alias,32*u8
gossipctl_init,,update_channel_interval,u32

Can't render this file because it has a wrong number of fields in line 6.

6
gossipd/gossipd.c

@ -367,7 +367,7 @@ static bool node_announcement_redundant(struct daemon *daemon)
return false;
if (!memeq(daemon->globalfeatures, tal_count(daemon->globalfeatures),
n->gfeatures, tal_count(n->gfeatures)))
n->globalfeatures, tal_count(n->globalfeatures)))
return false;
return true;
@ -1469,12 +1469,12 @@ static struct io_plan *getnodes(struct io_conn *conn, struct daemon *daemon,
if (id) {
n = get_node(daemon->rstate, id);
if (n)
append_node(&nodes, id, n->gfeatures, n);
append_node(&nodes, id, n->globalfeatures, n);
} else {
struct node_map_iter i;
n = node_map_first(daemon->rstate->nodes, &i);
while (n != NULL) {
append_node(&nodes, &n->id, n->gfeatures, n);
append_node(&nodes, &n->id, n->globalfeatures, n);
n = node_map_next(daemon->rstate->nodes, &i);
}
}

6
gossipd/routing.c

@ -145,7 +145,7 @@ static struct node *new_node(struct routing_state *rstate,
n = tal(rstate, struct node);
n->id = *id;
n->chans = tal_arr(n, struct chan *, 0);
n->gfeatures = NULL;
n->globalfeatures = NULL;
n->node_announcement = NULL;
n->node_announcement_index = 0;
n->last_timestamp = -1;
@ -1307,8 +1307,8 @@ bool routing_add_node_announcement(struct routing_state *rstate, const u8 *msg T
node->last_timestamp = timestamp;
memcpy(node->rgb_color, rgb_color, ARRAY_SIZE(node->rgb_color));
memcpy(node->alias, alias, ARRAY_SIZE(node->alias));
tal_free(node->gfeatures);
node->gfeatures = tal_steal(node, features);
tal_free(node->globalfeatures);
node->globalfeatures = tal_steal(node, features);
tal_free(node->node_announcement);
node->node_announcement = tal_dup_arr(node, u8, msg, tal_count(msg), 0);

2
gossipd/routing.h

@ -117,7 +117,7 @@ struct node {
u8 rgb_color[3];
/* (Global) features */
u8 *gfeatures;
u8 *globalfeatures;
/* Cached `node_announcement` we might forward to new peers (or NULL). */
const u8 *node_announcement;

Loading…
Cancel
Save