mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
chore: fix typo announcable -> announceable
"announcable" is a common misspelling of "announceable", see: https://en.wiktionary.org/wiki/announcable
This commit is contained in:
committed by
Rusty Russell
parent
2c55c27ad4
commit
e92176248e
@@ -1177,13 +1177,13 @@ static bool public_address(struct daemon *daemon, struct wireaddr *wireaddr)
|
|||||||
return address_routable(wireaddr, daemon->dev_allow_localhost);
|
return address_routable(wireaddr, daemon->dev_allow_localhost);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void add_announcable(struct wireaddr **announcable,
|
static void add_announceable(struct wireaddr **announceable,
|
||||||
const struct wireaddr *addr)
|
const struct wireaddr *addr)
|
||||||
{
|
{
|
||||||
/*~ utils.h contains a convenience macro tal_arr_expand which
|
/*~ utils.h contains a convenience macro tal_arr_expand which
|
||||||
* reallocates a tal_arr to make it one longer, then returns a pointer
|
* reallocates a tal_arr to make it one longer, then returns a pointer
|
||||||
* to the (new) last element. */
|
* 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
|
/*~ 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, ones we announce but don't bind to, and ones we bind to and
|
||||||
* announce if they seem to be public addresses.
|
* 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
|
* and returns the addresses we bound to (by convention, return is allocated
|
||||||
* off `ctx` argument).
|
* off `ctx` argument).
|
||||||
*
|
*
|
||||||
@@ -1254,7 +1254,7 @@ setup_listeners(const tal_t *ctx,
|
|||||||
/* For each one, listen, announce or both */
|
/* For each one, listen, announce or both */
|
||||||
const enum addr_listen_announce *proposed_listen_announce,
|
const enum addr_listen_announce *proposed_listen_announce,
|
||||||
const char *tor_password,
|
const char *tor_password,
|
||||||
struct wireaddr **announcable,
|
struct wireaddr **announceable,
|
||||||
char **errstr)
|
char **errstr)
|
||||||
{
|
{
|
||||||
struct sockaddr_un addrun;
|
struct sockaddr_un addrun;
|
||||||
@@ -1267,7 +1267,7 @@ setup_listeners(const tal_t *ctx,
|
|||||||
|
|
||||||
/* Start with empty arrays, for tal_arr_expand() */
|
/* Start with empty arrays, for tal_arr_expand() */
|
||||||
listen_fds = tal_arr(ctx, const struct listen_fd *, 0);
|
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
|
/* Add addresses we've explicitly been told to *first*: implicit
|
||||||
* addresses will be discarded then if we have multiple. */
|
* 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! */
|
/* You can only announce wiretypes, not internal formats! */
|
||||||
assert(proposed_wireaddr[i].itype
|
assert(proposed_wireaddr[i].itype
|
||||||
== ADDR_INTERNAL_WIREADDR);
|
== ADDR_INTERNAL_WIREADDR);
|
||||||
add_announcable(announcable, &wa.u.wireaddr);
|
add_announceable(announceable, &wa.u.wireaddr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now look for listening addresses. */
|
/* Now look for listening addresses. */
|
||||||
@@ -1338,8 +1338,8 @@ setup_listeners(const tal_t *ctx,
|
|||||||
tal_steal(listen_fds, lfd));
|
tal_steal(listen_fds, lfd));
|
||||||
if (announce
|
if (announce
|
||||||
&& public_address(daemon, &wa.u.wireaddr))
|
&& public_address(daemon, &wa.u.wireaddr))
|
||||||
add_announcable(announcable,
|
add_announceable(announceable,
|
||||||
&wa.u.wireaddr);
|
&wa.u.wireaddr);
|
||||||
}
|
}
|
||||||
ipv6_ok = (lfd != NULL);
|
ipv6_ok = (lfd != NULL);
|
||||||
|
|
||||||
@@ -1356,7 +1356,7 @@ setup_listeners(const tal_t *ctx,
|
|||||||
tal_steal(listen_fds, lfd));
|
tal_steal(listen_fds, lfd));
|
||||||
if (announce
|
if (announce
|
||||||
&& public_address(daemon, &wa.u.wireaddr))
|
&& public_address(daemon, &wa.u.wireaddr))
|
||||||
add_announcable(announcable,
|
add_announceable(announceable,
|
||||||
&wa.u.wireaddr);
|
&wa.u.wireaddr);
|
||||||
} else if (!ipv6_ok) {
|
} else if (!ipv6_ok) {
|
||||||
/* Both failed, return now, errstr set. */
|
/* Both failed, return now, errstr set. */
|
||||||
@@ -1372,7 +1372,7 @@ setup_listeners(const tal_t *ctx,
|
|||||||
return NULL;
|
return NULL;
|
||||||
tal_arr_expand(&listen_fds, tal_steal(listen_fds, lfd));
|
tal_arr_expand(&listen_fds, tal_steal(listen_fds, lfd));
|
||||||
if (announce && public_address(daemon, &wa.u.wireaddr))
|
if (announce && public_address(daemon, &wa.u.wireaddr))
|
||||||
add_announcable(announcable, &wa.u.wireaddr);
|
add_announceable(announceable, &wa.u.wireaddr);
|
||||||
continue;
|
continue;
|
||||||
case ADDR_INTERNAL_FORPROXY:
|
case ADDR_INTERNAL_FORPROXY:
|
||||||
break;
|
break;
|
||||||
@@ -1425,10 +1425,10 @@ setup_listeners(const tal_t *ctx,
|
|||||||
* there is also at least one address of
|
* there is also at least one address of
|
||||||
* different type.
|
* different type.
|
||||||
*/
|
*/
|
||||||
if (tal_count(*announcable) != 0) {
|
if (tal_count(*announceable) != 0) {
|
||||||
wireaddr_from_websocket(&addr.u.wireaddr,
|
wireaddr_from_websocket(&addr.u.wireaddr,
|
||||||
daemon->websocket_port);
|
daemon->websocket_port);
|
||||||
add_announcable(announcable,
|
add_announceable(announceable,
|
||||||
&addr.u.wireaddr);
|
&addr.u.wireaddr);
|
||||||
} else {
|
} else {
|
||||||
status_unusual("Bound to websocket %s,"
|
status_unusual("Bound to websocket %s,"
|
||||||
@@ -1469,7 +1469,7 @@ setup_listeners(const tal_t *ctx,
|
|||||||
if (!(proposed_listen_announce[i] & ADDR_ANNOUNCE)) {
|
if (!(proposed_listen_announce[i] & ADDR_ANNOUNCE)) {
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
add_announcable(announcable, toraddr);
|
add_announceable(announceable, toraddr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now we have bindings, set up any Tor static addresses: we will point
|
/* 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)) {
|
if (!(proposed_listen_announce[i] & ADDR_ANNOUNCE)) {
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
add_announcable(announcable, toraddr);
|
add_announceable(announceable, toraddr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*~ The spec used to ban more than one address of each type, but
|
/*~ 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.
|
* - 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;
|
*errstr = NULL;
|
||||||
return listen_fds;
|
return listen_fds;
|
||||||
@@ -1543,7 +1543,7 @@ static void connect_init(struct daemon *daemon, const u8 *msg)
|
|||||||
struct wireaddr_internal *binding;
|
struct wireaddr_internal *binding;
|
||||||
struct wireaddr_internal *proposed_wireaddr;
|
struct wireaddr_internal *proposed_wireaddr;
|
||||||
enum addr_listen_announce *proposed_listen_announce;
|
enum addr_listen_announce *proposed_listen_announce;
|
||||||
struct wireaddr *announcable;
|
struct wireaddr *announceable;
|
||||||
char *tor_password;
|
char *tor_password;
|
||||||
bool dev_fast_gossip;
|
bool dev_fast_gossip;
|
||||||
bool dev_disconnect;
|
bool dev_disconnect;
|
||||||
@@ -1602,7 +1602,7 @@ static void connect_init(struct daemon *daemon, const u8 *msg)
|
|||||||
proposed_wireaddr,
|
proposed_wireaddr,
|
||||||
proposed_listen_announce,
|
proposed_listen_announce,
|
||||||
tor_password,
|
tor_password,
|
||||||
&announcable,
|
&announceable,
|
||||||
&errstr);
|
&errstr);
|
||||||
|
|
||||||
/* Free up old allocations */
|
/* Free up old allocations */
|
||||||
@@ -1623,13 +1623,13 @@ static void connect_init(struct daemon *daemon, const u8 *msg)
|
|||||||
daemon_conn_send(daemon->master,
|
daemon_conn_send(daemon->master,
|
||||||
take(towire_connectd_init_reply(NULL,
|
take(towire_connectd_init_reply(NULL,
|
||||||
binding,
|
binding,
|
||||||
announcable,
|
announceable,
|
||||||
errstr)));
|
errstr)));
|
||||||
/*~ Who cares about a little once-off memory leak? Turns out we do!
|
/*~ Who cares about a little once-off memory leak? Turns out we do!
|
||||||
* We have a memory leak checker which scans for allocated memory
|
* 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
|
* 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. */
|
* not always a real problem), and this would (did!) trigger it. */
|
||||||
tal_free(announcable);
|
tal_free(announceable);
|
||||||
|
|
||||||
#if DEVELOPER
|
#if DEVELOPER
|
||||||
if (dev_disconnect)
|
if (dev_disconnect)
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ msgdata,connectd_init,dev_disconnect,bool,
|
|||||||
msgtype,connectd_init_reply,2100
|
msgtype,connectd_init_reply,2100
|
||||||
msgdata,connectd_init_reply,num_bindings,u16,
|
msgdata,connectd_init_reply,num_bindings,u16,
|
||||||
msgdata,connectd_init_reply,bindings,wireaddr_internal,num_bindings
|
msgdata,connectd_init_reply,bindings,wireaddr_internal,num_bindings
|
||||||
msgdata,connectd_init_reply,num_announcable,u16,
|
msgdata,connectd_init_reply,num_announceable,u16,
|
||||||
msgdata,connectd_init_reply,announcable,wireaddr,num_announcable
|
msgdata,connectd_init_reply,announceable,wireaddr,num_announceable
|
||||||
msgdata,connectd_init_reply,failmsg,?wirestring,
|
msgdata,connectd_init_reply,failmsg,?wirestring,
|
||||||
|
|
||||||
# Activate the connect daemon, so others can connect.
|
# Activate the connect daemon, so others can connect.
|
||||||
@@ -75,7 +75,7 @@ msgdata,connectd_peer_connected,features,u8,flen
|
|||||||
msgtype,connectd_peer_disconnected,2015
|
msgtype,connectd_peer_disconnected,2015
|
||||||
msgdata,connectd_peer_disconnected,id,node_id,
|
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
|
msgtype,connectd_peer_final_msg,2003
|
||||||
msgdata,connectd_peer_final_msg,id,node_id,
|
msgdata,connectd_peer_final_msg,id,node_id,
|
||||||
msgdata,connectd_peer_final_msg,len,u16,
|
msgdata,connectd_peer_final_msg,len,u16,
|
||||||
|
|||||||
|
@@ -38,8 +38,8 @@ static u8 *create_node_announcement(const tal_t *ctx, struct daemon *daemon,
|
|||||||
if (!sig)
|
if (!sig)
|
||||||
sig = talz(tmpctx, secp256k1_ecdsa_signature);
|
sig = talz(tmpctx, secp256k1_ecdsa_signature);
|
||||||
|
|
||||||
for (i = 0; i < tal_count(daemon->announcable); i++)
|
for (i = 0; i < tal_count(daemon->announceable); i++)
|
||||||
towire_wireaddr(&addresses, &daemon->announcable[i]);
|
towire_wireaddr(&addresses, &daemon->announceable[i]);
|
||||||
|
|
||||||
na_tlv = tlv_node_ann_tlvs_new(tmpctx);
|
na_tlv = tlv_node_ann_tlvs_new(tmpctx);
|
||||||
na_tlv->option_will_fund = cast_const(struct lease_rates *, rates);
|
na_tlv->option_will_fund = cast_const(struct lease_rates *, rates);
|
||||||
|
|||||||
@@ -672,7 +672,7 @@ static void gossip_init(struct daemon *daemon, const u8 *msg)
|
|||||||
&daemon->id,
|
&daemon->id,
|
||||||
daemon->rgb,
|
daemon->rgb,
|
||||||
daemon->alias,
|
daemon->alias,
|
||||||
&daemon->announcable,
|
&daemon->announceable,
|
||||||
&dev_gossip_time,
|
&dev_gossip_time,
|
||||||
&dev_fast_gossip,
|
&dev_fast_gossip,
|
||||||
&dev_fast_gossip_prune)) {
|
&dev_fast_gossip_prune)) {
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ struct daemon {
|
|||||||
u8 rgb[3];
|
u8 rgb[3];
|
||||||
|
|
||||||
/* What addresses we can actually announce. */
|
/* What addresses we can actually announce. */
|
||||||
struct wireaddr *announcable;
|
struct wireaddr *announceable;
|
||||||
|
|
||||||
/* Timer until we can send an updated node_announcement */
|
/* Timer until we can send an updated node_announcement */
|
||||||
struct oneshot *node_announce_timer;
|
struct oneshot *node_announce_timer;
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ msgdata,gossipd_init,our_features,feature_set,
|
|||||||
msgdata,gossipd_init,id,node_id,
|
msgdata,gossipd_init,id,node_id,
|
||||||
msgdata,gossipd_init,rgb,u8,3
|
msgdata,gossipd_init,rgb,u8,3
|
||||||
msgdata,gossipd_init,alias,u8,32
|
msgdata,gossipd_init,alias,u8,32
|
||||||
msgdata,gossipd_init,num_announcable,u16,
|
msgdata,gossipd_init,num_announceable,u16,
|
||||||
msgdata,gossipd_init,announcable,wireaddr,num_announcable
|
msgdata,gossipd_init,announceable,wireaddr,num_announceable
|
||||||
msgdata,gossipd_init,dev_gossip_time,?u32,
|
msgdata,gossipd_init,dev_gossip_time,?u32,
|
||||||
msgdata,gossipd_init,dev_fast_gossip,bool,
|
msgdata,gossipd_init,dev_fast_gossip,bool,
|
||||||
msgdata,gossipd_init,dev_fast_gossip_prune,bool,
|
msgdata,gossipd_init,dev_fast_gossip_prune,bool,
|
||||||
|
|||||||
|
@@ -469,7 +469,7 @@ static void connect_init_done(struct subd *connectd,
|
|||||||
log_debug(connectd->log, "connectd_init_done");
|
log_debug(connectd->log, "connectd_init_done");
|
||||||
if (!fromwire_connectd_init_reply(ld, reply,
|
if (!fromwire_connectd_init_reply(ld, reply,
|
||||||
&ld->binding,
|
&ld->binding,
|
||||||
&ld->announcable,
|
&ld->announceable,
|
||||||
&errmsg))
|
&errmsg))
|
||||||
fatal("Bad connectd_init_reply: %s",
|
fatal("Bad connectd_init_reply: %s",
|
||||||
tal_hex(reply, reply));
|
tal_hex(reply, reply));
|
||||||
|
|||||||
@@ -258,7 +258,7 @@ void gossip_init(struct lightningd *ld, int connectd_fd)
|
|||||||
&ld->id,
|
&ld->id,
|
||||||
ld->rgb,
|
ld->rgb,
|
||||||
ld->alias,
|
ld->alias,
|
||||||
ld->announcable,
|
ld->announceable,
|
||||||
IFDEV(ld->dev_gossip_time ? &ld->dev_gossip_time: NULL, NULL),
|
IFDEV(ld->dev_gossip_time ? &ld->dev_gossip_time: NULL, NULL),
|
||||||
IFDEV(ld->dev_fast_gossip, false),
|
IFDEV(ld->dev_fast_gossip, false),
|
||||||
IFDEV(ld->dev_fast_gossip_prune, false));
|
IFDEV(ld->dev_fast_gossip_prune, false));
|
||||||
|
|||||||
@@ -144,9 +144,9 @@ struct lightningd {
|
|||||||
/* Setup: And the bitset for each, whether to listen, announce or both */
|
/* Setup: And the bitset for each, whether to listen, announce or both */
|
||||||
enum addr_listen_announce *proposed_listen_announce;
|
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_internal *binding;
|
||||||
struct wireaddr *announcable;
|
struct wireaddr *announceable;
|
||||||
|
|
||||||
/* Bearer of all my secrets. */
|
/* Bearer of all my secrets. */
|
||||||
int hsm_fd;
|
int hsm_fd;
|
||||||
|
|||||||
@@ -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. */
|
/* Can't announce anything that's not a normal wireaddr. */
|
||||||
if (ld->proposed_wireaddr[n].itype != ADDR_INTERNAL_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);
|
arg);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
@@ -1723,8 +1723,8 @@ static struct command_result *json_getinfo(struct command *cmd,
|
|||||||
if (cmd->ld->listen) {
|
if (cmd->ld->listen) {
|
||||||
/* These are the addresses we're announcing */
|
/* These are the addresses we're announcing */
|
||||||
json_array_start(response, "address");
|
json_array_start(response, "address");
|
||||||
for (size_t i = 0; i < tal_count(cmd->ld->announcable); i++)
|
for (size_t i = 0; i < tal_count(cmd->ld->announceable); i++)
|
||||||
json_add_address(response, NULL, cmd->ld->announcable+i);
|
json_add_address(response, NULL, cmd->ld->announceable+i);
|
||||||
json_array_end(response);
|
json_array_end(response);
|
||||||
|
|
||||||
/* This is what we're actually bound to. */
|
/* This is what we're actually bound to. */
|
||||||
|
|||||||
@@ -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
|
# Reorg changes short_channel_id 103x1x0 to 104x1x0, l1 sees it, restarts channeld
|
||||||
bitcoind.simple_reorg(103, 1) # heights 103 - 108
|
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)
|
bitcoind.generate_block(1)
|
||||||
l1.daemon.wait_for_log(r'Peer transient failure .* short_channel_id changed to 104x1x0 \(was 103x1x0\)')
|
l1.daemon.wait_for_log(r'Peer transient failure .* short_channel_id changed to 104x1x0 \(was 103x1x0\)')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user