diff --git a/connectd/connectd.c b/connectd/connectd.c index 68ea866b3..c47e11b9e 100644 --- a/connectd/connectd.c +++ b/connectd/connectd.c @@ -1177,13 +1177,13 @@ static bool public_address(struct daemon *daemon, struct wireaddr *wireaddr) return address_routable(wireaddr, daemon->dev_allow_localhost); } -static void add_announcable(struct wireaddr **announcable, - const struct wireaddr *addr) +static void add_announceable(struct wireaddr **announceable, + const struct wireaddr *addr) { /*~ utils.h contains a convenience macro tal_arr_expand which * reallocates a tal_arr to make it one longer, then returns a pointer * to the (new) last element. */ - tal_arr_expand(announcable, *addr); + tal_arr_expand(announceable, *addr); } /*~ ccan/asort provides a type-safe sorting function; it requires a comparison @@ -1238,7 +1238,7 @@ static bool want_tor(const struct wireaddr_internal *proposed_wireaddr) * announce, ones we announce but don't bind to, and ones we bind to and * announce if they seem to be public addresses. * - * This routine sorts out the mess: it populates the *announcable array, + * This routine sorts out the mess: it populates the *announceable array, * and returns the addresses we bound to (by convention, return is allocated * off `ctx` argument). * @@ -1254,7 +1254,7 @@ setup_listeners(const tal_t *ctx, /* For each one, listen, announce or both */ const enum addr_listen_announce *proposed_listen_announce, const char *tor_password, - struct wireaddr **announcable, + struct wireaddr **announceable, char **errstr) { struct sockaddr_un addrun; @@ -1267,7 +1267,7 @@ setup_listeners(const tal_t *ctx, /* Start with empty arrays, for tal_arr_expand() */ listen_fds = tal_arr(ctx, const struct listen_fd *, 0); - *announcable = tal_arr(ctx, struct wireaddr, 0); + *announceable = tal_arr(ctx, struct wireaddr, 0); /* Add addresses we've explicitly been told to *first*: implicit * addresses will be discarded then if we have multiple. */ @@ -1282,7 +1282,7 @@ setup_listeners(const tal_t *ctx, /* You can only announce wiretypes, not internal formats! */ assert(proposed_wireaddr[i].itype == ADDR_INTERNAL_WIREADDR); - add_announcable(announcable, &wa.u.wireaddr); + add_announceable(announceable, &wa.u.wireaddr); } /* Now look for listening addresses. */ @@ -1338,8 +1338,8 @@ setup_listeners(const tal_t *ctx, tal_steal(listen_fds, lfd)); if (announce && public_address(daemon, &wa.u.wireaddr)) - add_announcable(announcable, - &wa.u.wireaddr); + add_announceable(announceable, + &wa.u.wireaddr); } ipv6_ok = (lfd != NULL); @@ -1356,7 +1356,7 @@ setup_listeners(const tal_t *ctx, tal_steal(listen_fds, lfd)); if (announce && public_address(daemon, &wa.u.wireaddr)) - add_announcable(announcable, + add_announceable(announceable, &wa.u.wireaddr); } else if (!ipv6_ok) { /* Both failed, return now, errstr set. */ @@ -1372,7 +1372,7 @@ setup_listeners(const tal_t *ctx, return NULL; tal_arr_expand(&listen_fds, tal_steal(listen_fds, lfd)); if (announce && public_address(daemon, &wa.u.wireaddr)) - add_announcable(announcable, &wa.u.wireaddr); + add_announceable(announceable, &wa.u.wireaddr); continue; case ADDR_INTERNAL_FORPROXY: break; @@ -1425,10 +1425,10 @@ setup_listeners(const tal_t *ctx, * there is also at least one address of * different type. */ - if (tal_count(*announcable) != 0) { + if (tal_count(*announceable) != 0) { wireaddr_from_websocket(&addr.u.wireaddr, daemon->websocket_port); - add_announcable(announcable, + add_announceable(announceable, &addr.u.wireaddr); } else { status_unusual("Bound to websocket %s," @@ -1469,7 +1469,7 @@ setup_listeners(const tal_t *ctx, if (!(proposed_listen_announce[i] & ADDR_ANNOUNCE)) { continue; }; - add_announcable(announcable, toraddr); + add_announceable(announceable, toraddr); } /* Now we have bindings, set up any Tor static addresses: we will point @@ -1516,7 +1516,7 @@ setup_listeners(const tal_t *ctx, if (!(proposed_listen_announce[i] & ADDR_ANNOUNCE)) { continue; }; - add_announcable(announcable, toraddr); + add_announceable(announceable, toraddr); } /*~ The spec used to ban more than one address of each type, but @@ -1527,7 +1527,7 @@ setup_listeners(const tal_t *ctx, *... * - MUST place address descriptors in ascending order. */ - asort(*announcable, tal_count(*announcable), wireaddr_cmp_type, NULL); + asort(*announceable, tal_count(*announceable), wireaddr_cmp_type, NULL); *errstr = NULL; return listen_fds; @@ -1543,7 +1543,7 @@ static void connect_init(struct daemon *daemon, const u8 *msg) struct wireaddr_internal *binding; struct wireaddr_internal *proposed_wireaddr; enum addr_listen_announce *proposed_listen_announce; - struct wireaddr *announcable; + struct wireaddr *announceable; char *tor_password; bool dev_fast_gossip; bool dev_disconnect; @@ -1602,7 +1602,7 @@ static void connect_init(struct daemon *daemon, const u8 *msg) proposed_wireaddr, proposed_listen_announce, tor_password, - &announcable, + &announceable, &errstr); /* Free up old allocations */ @@ -1623,13 +1623,13 @@ static void connect_init(struct daemon *daemon, const u8 *msg) daemon_conn_send(daemon->master, take(towire_connectd_init_reply(NULL, binding, - announcable, + announceable, errstr))); /*~ Who cares about a little once-off memory leak? Turns out we do! * We have a memory leak checker which scans for allocated memory * with no pointers to it (a tell-tale leak sign, though with tal it's * not always a real problem), and this would (did!) trigger it. */ - tal_free(announcable); + tal_free(announceable); #if DEVELOPER if (dev_disconnect) diff --git a/connectd/connectd_wire.csv b/connectd/connectd_wire.csv index 63ef72f3e..de580c0e3 100644 --- a/connectd/connectd_wire.csv +++ b/connectd/connectd_wire.csv @@ -29,8 +29,8 @@ msgdata,connectd_init,dev_disconnect,bool, msgtype,connectd_init_reply,2100 msgdata,connectd_init_reply,num_bindings,u16, msgdata,connectd_init_reply,bindings,wireaddr_internal,num_bindings -msgdata,connectd_init_reply,num_announcable,u16, -msgdata,connectd_init_reply,announcable,wireaddr,num_announcable +msgdata,connectd_init_reply,num_announceable,u16, +msgdata,connectd_init_reply,announceable,wireaddr,num_announceable msgdata,connectd_init_reply,failmsg,?wirestring, # Activate the connect daemon, so others can connect. @@ -75,7 +75,7 @@ msgdata,connectd_peer_connected,features,u8,flen msgtype,connectd_peer_disconnected,2015 msgdata,connectd_peer_disconnected,id,node_id, -# master -> connectd: give message to peer and disconnect. +# master -> connectd: give message to peer and disconnect. msgtype,connectd_peer_final_msg,2003 msgdata,connectd_peer_final_msg,id,node_id, msgdata,connectd_peer_final_msg,len,u16, diff --git a/gossipd/gossip_generation.c b/gossipd/gossip_generation.c index 3180d52be..b0596bdfe 100644 --- a/gossipd/gossip_generation.c +++ b/gossipd/gossip_generation.c @@ -38,8 +38,8 @@ static u8 *create_node_announcement(const tal_t *ctx, struct daemon *daemon, if (!sig) sig = talz(tmpctx, secp256k1_ecdsa_signature); - for (i = 0; i < tal_count(daemon->announcable); i++) - towire_wireaddr(&addresses, &daemon->announcable[i]); + for (i = 0; i < tal_count(daemon->announceable); i++) + towire_wireaddr(&addresses, &daemon->announceable[i]); na_tlv = tlv_node_ann_tlvs_new(tmpctx); na_tlv->option_will_fund = cast_const(struct lease_rates *, rates); diff --git a/gossipd/gossipd.c b/gossipd/gossipd.c index eaec43f7b..0b660daf8 100644 --- a/gossipd/gossipd.c +++ b/gossipd/gossipd.c @@ -672,7 +672,7 @@ static void gossip_init(struct daemon *daemon, const u8 *msg) &daemon->id, daemon->rgb, daemon->alias, - &daemon->announcable, + &daemon->announceable, &dev_gossip_time, &dev_fast_gossip, &dev_fast_gossip_prune)) { diff --git a/gossipd/gossipd.h b/gossipd/gossipd.h index 70c3ca485..a108f3866 100644 --- a/gossipd/gossipd.h +++ b/gossipd/gossipd.h @@ -45,7 +45,7 @@ struct daemon { u8 rgb[3]; /* What addresses we can actually announce. */ - struct wireaddr *announcable; + struct wireaddr *announceable; /* Timer until we can send an updated node_announcement */ struct oneshot *node_announce_timer; diff --git a/gossipd/gossipd_wire.csv b/gossipd/gossipd_wire.csv index e5369751e..300220484 100644 --- a/gossipd/gossipd_wire.csv +++ b/gossipd/gossipd_wire.csv @@ -11,8 +11,8 @@ msgdata,gossipd_init,our_features,feature_set, msgdata,gossipd_init,id,node_id, msgdata,gossipd_init,rgb,u8,3 msgdata,gossipd_init,alias,u8,32 -msgdata,gossipd_init,num_announcable,u16, -msgdata,gossipd_init,announcable,wireaddr,num_announcable +msgdata,gossipd_init,num_announceable,u16, +msgdata,gossipd_init,announceable,wireaddr,num_announceable msgdata,gossipd_init,dev_gossip_time,?u32, msgdata,gossipd_init,dev_fast_gossip,bool, msgdata,gossipd_init,dev_fast_gossip_prune,bool, diff --git a/lightningd/connect_control.c b/lightningd/connect_control.c index 322ceb69f..f62d83c1a 100644 --- a/lightningd/connect_control.c +++ b/lightningd/connect_control.c @@ -469,7 +469,7 @@ static void connect_init_done(struct subd *connectd, log_debug(connectd->log, "connectd_init_done"); if (!fromwire_connectd_init_reply(ld, reply, &ld->binding, - &ld->announcable, + &ld->announceable, &errmsg)) fatal("Bad connectd_init_reply: %s", tal_hex(reply, reply)); diff --git a/lightningd/gossip_control.c b/lightningd/gossip_control.c index e16607345..b1dfbe8e4 100644 --- a/lightningd/gossip_control.c +++ b/lightningd/gossip_control.c @@ -258,7 +258,7 @@ void gossip_init(struct lightningd *ld, int connectd_fd) &ld->id, ld->rgb, ld->alias, - ld->announcable, + ld->announceable, IFDEV(ld->dev_gossip_time ? &ld->dev_gossip_time: NULL, NULL), IFDEV(ld->dev_fast_gossip, false), IFDEV(ld->dev_fast_gossip_prune, false)); diff --git a/lightningd/lightningd.h b/lightningd/lightningd.h index 25a5db475..5573a9470 100644 --- a/lightningd/lightningd.h +++ b/lightningd/lightningd.h @@ -144,9 +144,9 @@ struct lightningd { /* Setup: And the bitset for each, whether to listen, announce or both */ enum addr_listen_announce *proposed_listen_announce; - /* Actual bindings and announcables from gossipd */ + /* Actual bindings and announceables from gossipd */ struct wireaddr_internal *binding; - struct wireaddr *announcable; + struct wireaddr *announceable; /* Bearer of all my secrets. */ int hsm_fd; diff --git a/lightningd/options.c b/lightningd/options.c index 0577b0a1e..4828180d6 100644 --- a/lightningd/options.c +++ b/lightningd/options.c @@ -304,7 +304,7 @@ static char *opt_add_announce_addr(const char *arg, struct lightningd *ld) /* Can't announce anything that's not a normal wireaddr. */ if (ld->proposed_wireaddr[n].itype != ADDR_INTERNAL_WIREADDR) - return tal_fmt(NULL, "address '%s' is not announcable", + return tal_fmt(NULL, "address '%s' is not announceable", arg); return NULL; diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index 5c4d43a34..45fa36dec 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -1723,8 +1723,8 @@ static struct command_result *json_getinfo(struct command *cmd, if (cmd->ld->listen) { /* These are the addresses we're announcing */ json_array_start(response, "address"); - for (size_t i = 0; i < tal_count(cmd->ld->announcable); i++) - json_add_address(response, NULL, cmd->ld->announcable+i); + for (size_t i = 0; i < tal_count(cmd->ld->announceable); i++) + json_add_address(response, NULL, cmd->ld->announceable+i); json_array_end(response); /* This is what we're actually bound to. */ diff --git a/tests/test_misc.py b/tests/test_misc.py index 083306d25..219739b48 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -1155,7 +1155,7 @@ def test_funding_reorg_remote_lags(node_factory, bitcoind): # Reorg changes short_channel_id 103x1x0 to 104x1x0, l1 sees it, restarts channeld bitcoind.simple_reorg(103, 1) # heights 103 - 108 - # But now it's height 104, we need another block to make it announcable. + # But now it's height 104, we need another block to make it announceable. bitcoind.generate_block(1) l1.daemon.wait_for_log(r'Peer transient failure .* short_channel_id changed to 104x1x0 \(was 103x1x0\)')