mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
connectd: rename peer_reconnected local var for clarity.
We call it 'pr' in the retry_peer_connected callback, so call it that here too. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -365,7 +365,7 @@ static struct io_plan *peer_reconnected(struct io_conn *conn,
|
|||||||
const u8 *localfeatures TAKES)
|
const u8 *localfeatures TAKES)
|
||||||
{
|
{
|
||||||
u8 *msg;
|
u8 *msg;
|
||||||
struct peer_reconnected *r;
|
struct peer_reconnected *pr;
|
||||||
|
|
||||||
status_trace("peer %s: reconnect",
|
status_trace("peer %s: reconnect",
|
||||||
type_to_string(tmpctx, struct pubkey, id));
|
type_to_string(tmpctx, struct pubkey, id));
|
||||||
@@ -375,24 +375,24 @@ static struct io_plan *peer_reconnected(struct io_conn *conn,
|
|||||||
daemon_conn_send(daemon->master, take(msg));
|
daemon_conn_send(daemon->master, take(msg));
|
||||||
|
|
||||||
/* Save arguments for next time. */
|
/* Save arguments for next time. */
|
||||||
r = tal(daemon, struct peer_reconnected);
|
pr = tal(daemon, struct peer_reconnected);
|
||||||
r->daemon = daemon;
|
pr->daemon = daemon;
|
||||||
r->id = *id;
|
pr->id = *id;
|
||||||
|
|
||||||
/*~ Note that tal_dup_arr() will do handle the take() of
|
/*~ Note that tal_dup_arr() will do handle the take() of
|
||||||
* peer_connected_msg and localfeatures (turning it into a simply
|
* peer_connected_msg and localfeatures (turning it into a simply
|
||||||
* tal_steal() in those cases). */
|
* tal_steal() in those cases). */
|
||||||
r->peer_connected_msg
|
pr->peer_connected_msg
|
||||||
= tal_dup_arr(r, u8, peer_connected_msg,
|
= tal_dup_arr(pr, u8, peer_connected_msg,
|
||||||
tal_count(peer_connected_msg), 0);
|
tal_count(peer_connected_msg), 0);
|
||||||
r->localfeatures
|
pr->localfeatures
|
||||||
= tal_dup_arr(r, u8, localfeatures, tal_count(localfeatures), 0);
|
= tal_dup_arr(pr, u8, localfeatures, tal_count(localfeatures), 0);
|
||||||
|
|
||||||
/*~ ccan/io supports waiting on an address: in this case, the key in
|
/*~ ccan/io supports waiting on an address: in this case, the key in
|
||||||
* the peer set. When someone calls `io_wake()` on that address, it
|
* the peer set. When someone calls `io_wake()` on that address, it
|
||||||
* will call retry_peer_connected above. */
|
* will call retry_peer_connected above. */
|
||||||
return io_wait(conn, pubkey_set_get(&daemon->peers, id),
|
return io_wait(conn, pubkey_set_get(&daemon->peers, id),
|
||||||
retry_peer_connected, r);
|
retry_peer_connected, pr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*~ Note the lack of static: this is called by peer_exchange_initmsg.c once the
|
/*~ Note the lack of static: this is called by peer_exchange_initmsg.c once the
|
||||||
|
|||||||
Reference in New Issue
Block a user