Browse Source

daemons tour: minor typos correction

travis-debug
darosior 5 years ago
committed by Rusty Russell
parent
commit
9be28fe40f
  1. 2
      closingd/closingd.c
  2. 8
      connectd/connectd.c
  3. 10
      gossipd/gossipd.c
  4. 26
      hsmd/hsmd.c

2
closingd/closingd.c

@ -171,7 +171,7 @@ static void do_reconnect(struct per_peer_state *pps,
&my_current_per_commitment_point);
sync_crypto_write(pps, take(msg));
/* They might have already send reestablish, which triggered us */
/* They might have already sent reestablish, which triggered us */
if (!channel_reestablish) {
do {
tal_free(channel_reestablish);

8
connectd/connectd.c

@ -297,7 +297,7 @@ static bool get_gossipfds(struct daemon *daemon,
gossip_queries_feature
= local_feature_negotiated(localfeatures, LOCAL_GOSSIP_QUERIES);
/*~ `initial_routing_sync is supported by every node, since it was in
/*~ `initial_routing_sync` is supported by every node, since it was in
* the initial lightning specification: it means the peer wants the
* backlog of existing gossip. */
initial_routing_sync
@ -318,7 +318,7 @@ static bool get_gossipfds(struct daemon *daemon,
"Failed parsing msg gossipctl: %s",
tal_hex(tmpctx, msg));
/* Gossipd might run out of file descriptors, so it tell us, and we
/* Gossipd might run out of file descriptors, so it tells us, and we
* give up on connecting this peer. */
if (!success) {
status_broken("Gossipd did not give us an fd: losing peer %s",
@ -454,7 +454,7 @@ struct io_plan *peer_connected(struct io_conn *conn,
/*~ daemon_conn is a message queue for inter-daemon communication: we
* queue up the `connect_peer_connected` message to tell lightningd
* we have connected, and give the the peer and gossip fds. */
* we have connected, and give the peer and gossip fds. */
daemon_conn_send(daemon->master, take(msg));
/* io_conn_fd() extracts the fd from ccan/io's io_conn */
daemon_conn_send_fd(daemon->master, io_conn_fd(conn));
@ -1385,7 +1385,7 @@ static void try_connect_peer(struct daemon *daemon,
list_add_tail(&daemon->connecting, &connect->list);
tal_add_destructor(connect, destroy_connecting);
/* Now we kick it off by trying connect->addrs[connect->addrnum] */
/* Now we kick it off by recursively trying connect->addrs[connect->addrnum] */
try_connect_one_addr(connect);
}

10
gossipd/gossipd.c

@ -449,7 +449,7 @@ static void setup_gossip_range(struct peer *peer)
queue_peer_msg(peer, take(msg));
}
/* Create a node_announcement with the given signature. It may be NULL in the
/*~ Create a node_announcement with the given signature. It may be NULL in the
* case we need to create a provisional announcement for the HSM to sign.
* This is called twice: once with the dummy signature to get it signed and a
* second time to build the full packet with the signature. The timestamp is
@ -507,7 +507,7 @@ static void send_node_announcement(struct daemon *daemon)
if (!fromwire_hsm_node_announcement_sig_reply(msg, &sig))
status_failed(STATUS_FAIL_MASTER_IO, "HSM returned an invalid node_announcement sig");
/* We got the signature for out provisional node_announcement back
/* We got the signature for our provisional node_announcement back
* from the HSM, create the real announcement and forward it to
* gossipd so it can take care of forwarding it. */
nannounce = create_node_announcement(NULL, daemon, &sig, timestamp);
@ -772,8 +772,8 @@ static u8 *handle_channel_update_msg(struct peer *peer, const u8 *msg)
return err;
}
/*~ As a nasty compromise in the spec, we only forward channel_announce
* once we have a channel_update; the channel isn't *usable* for
/*~ As a nasty compromise in the spec, we only forward `channel_announce`
* once we have a `channel_update`; the channel isn't *usable* for
* routing until you have both anyway. For this reason, we might have
* just sent out our own channel_announce, so we check if it's time to
* send a node_announcement too. */
@ -1787,7 +1787,7 @@ static bool local_direction(struct daemon *daemon,
return false;
}
/*~ This is when channeld asks us for a channel_update for a local channel.
/*~ This is when channeld asks us for a `channel_update` for a local channel.
* It does that to fill in the error field when lightningd fails an HTLC and
* sets the UPDATE bit in the error type. lightningd is too important to
* fetch this itself, so channeld does it (channeld has to talk to us for

26
hsmd/hsmd.c

@ -128,7 +128,7 @@ static bool is_lightningd(const struct client *client)
return client == dbid_zero_clients[0];
}
/*~ FIXME: This is used by debug.c. Doesn't apply to us, but lets us link. */
/* FIXME: This is used by debug.c. Doesn't apply to us, but lets us link. */
extern void dev_disconnect_init(int fd);
void dev_disconnect_init(int fd UNUSED) { }
@ -490,7 +490,7 @@ static void bitcoin_key(struct privkey *privkey, struct pubkey *pubkey,
}
/*~ We store our root secret in a "hsm_secret" file (like all of c-lightning,
* we run in the user's .lightningd directory). */
* we run in the user's .lightning directory). */
static void maybe_create_new_hsm(void)
{
/*~ Note that this is opened for write-only, even though the permissions
@ -659,7 +659,7 @@ static struct io_plan *handle_cannouncement_sig(struct io_conn *conn,
*
* Note that 'check-source' will actually find and check this quote
* against the spec (if available); whitespace is ignored and
* ... means some content is skipped, but it works remarkably well to
* "..." means some content is skipped, but it works remarkably well to
* track spec changes. */
/* BOLT #7:
@ -769,7 +769,7 @@ static struct io_plan *handle_channel_update_sig(struct io_conn *conn,
return req_reply(conn, c, take(towire_hsm_cupdate_sig_reply(NULL, cu)));
}
/*~ This gets the basepoints for a channel; it's not privite information really
/*~ This gets the basepoints for a channel; it's not private information really
* (we tell the peer this to establish a channel, as it sets up the keys used
* for each transaction).
*
@ -848,7 +848,7 @@ static struct io_plan *handle_sign_commitment_tx(struct io_conn *conn,
* output it's spending), so in our 'bitcoin_tx' structure it's a
* pointer, as we don't always know it (and zero is a valid amount, so
* NULL is better to mean 'unknown' and has the nice property that
* you'll crash if you assume it's there and you're wrong. */
* you'll crash if you assume it's there and you're wrong.) */
tx->input_amounts[0] = tal_dup(tx, struct amount_sat, &funding);
sign_tx_input(tx, 0, NULL, funding_wscript,
&secrets.funding_privkey,
@ -1041,7 +1041,7 @@ static struct io_plan *handle_sign_delayed_payment_to_us(struct io_conn *conn,
tx, &privkey, wscript, input_sat);
}
/*~ This is used when the a commitment transaction is onchain, and has an HTLC
/*~ This is used when a commitment transaction is onchain, and has an HTLC
* output paying to us (because we have the preimage); this signs that
* transaction, which lightningd will broadcast to collect the funds. */
static struct io_plan *handle_sign_remote_htlc_to_us(struct io_conn *conn,
@ -1125,7 +1125,7 @@ static struct io_plan *handle_sign_penalty_to_us(struct io_conn *conn,
tx, &privkey, wscript, input_sat);
}
/*~ This is used when the a commitment transaction is onchain, and has an HTLC
/*~ This is used when a commitment transaction is onchain, and has an HTLC
* output paying to them, which has timed out; this signs that transaction,
* which lightningd will broadcast to collect the funds. */
static struct io_plan *handle_sign_local_htlc_tx(struct io_conn *conn,
@ -1334,7 +1334,7 @@ static struct io_plan *send_pending_client_fd(struct io_conn *conn,
return io_send_fd(conn, fd, true, client_read_next, master);
}
/*~ This is used by by the master to create a new client connection (which
/*~ This is used by the master to create a new client connection (which
* becomes the HSM_FD for the subdaemon after forking). */
static struct io_plan *pass_client_hsmfd(struct io_conn *conn,
struct client *c,
@ -1503,7 +1503,7 @@ static struct io_plan *handle_sign_funding_tx(struct io_conn *conn,
return req_reply(conn, c, take(towire_hsm_sign_funding_reply(NULL, tx)));
}
/*~ lightningd asks us to sign a withdrawal; same as above but we in theory
/*~ lightningd asks us to sign a withdrawal; same as above but in theory
* we can do more to check the previous case is valid. */
static struct io_plan *handle_sign_withdrawal_tx(struct io_conn *conn,
struct client *c,
@ -1571,7 +1571,7 @@ static struct io_plan *handle_sign_invoice(struct io_conn *conn,
/* FIXME: Check invoice! */
/* tal_dup_arr() does what you'd expect: allocate an array by copying
/*~ tal_dup_arr() does what you'd expect: allocate an array by copying
* another; the cast is needed because the hrp is a 'char' array, not
* a 'u8' (unsigned char) as it's the "human readable" part.
*
@ -1723,8 +1723,8 @@ static bool check_client_capabilities(struct client *client,
case WIRE_HSM_DEV_MEMLEAK:
return (client->capabilities & HSM_CAP_MASTER) != 0;
/*~ These are messages sent by the HSM so we should never receive them.
* FIXME: Since we autogenerate these, we should really generate separate
/*~ These are messages sent by the HSM so we should never receive them. */
/* FIXME: Since we autogenerate these, we should really generate separate
* enums for replies to avoid this kind of clutter! */
case WIRE_HSM_ECDH_RESP:
case WIRE_HSM_CANNOUNCEMENT_SIG_REPLY:
@ -1880,7 +1880,7 @@ int main(int argc, char *argv[])
/* When conn closes, everything is freed. */
io_set_finish(master->conn, master_gone, master);
/*~ The two NULL args a list of timers, and the timer which expired:
/*~ The two NULL args are a list of timers, and the timer which expired:
* we don't have any timers. */
io_loop(NULL, NULL);

Loading…
Cancel
Save