From 33abf93ec19fe25d1bc4ba76afc807f75e1cd2f0 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 23 Mar 2022 07:00:59 +1030 Subject: [PATCH] lightningd: rename activate_peers() to setup_peers(). Activate means a specific thing now (connectd said something), so avoid confusing it with this function. Signed-off-by: Rusty Russell --- lightningd/lightningd.c | 2 +- lightningd/peer_control.c | 6 +++--- lightningd/peer_control.h | 2 +- lightningd/test/run-find_my_abspath.c | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lightningd/lightningd.c b/lightningd/lightningd.c index 0702a024f..f7ffa99eb 100644 --- a/lightningd/lightningd.c +++ b/lightningd/lightningd.c @@ -1151,7 +1151,7 @@ int main(int argc, char *argv[]) /*~ This is where we ask connectd to reconnect to any peers who have * live channels with us, and makes sure we're watching the funding * tx. */ - activate_peers(ld); + setup_peers(ld); /*~ Now that all the notifications for transactions are in place, we * can start the poll loop which queries bitcoind for new blocks. */ diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index 157be841a..263222993 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -1784,7 +1784,7 @@ command_find_channel(struct command *cmd, } } -static void activate_peer(struct peer *peer, u32 delay) +static void setup_peer(struct peer *peer, u32 delay) { struct channel *channel; struct channel_inflight *inflight; @@ -1815,14 +1815,14 @@ static void activate_peer(struct peer *peer, u32 delay) } } -void activate_peers(struct lightningd *ld) +void setup_peers(struct lightningd *ld) { struct peer *p; /* Avoid thundering herd: after first five, delay by 1 second. */ int delay = -5; list_for_each(&ld->peers, p, list) { - activate_peer(p, delay > 0 ? delay : 0); + setup_peer(p, delay > 0 ? delay : 0); delay++; } } diff --git a/lightningd/peer_control.h b/lightningd/peer_control.h index 5f006466a..4e3207609 100644 --- a/lightningd/peer_control.h +++ b/lightningd/peer_control.h @@ -84,7 +84,7 @@ void channel_errmsg(struct channel *channel, u8 *p2wpkh_for_keyidx(const tal_t *ctx, struct lightningd *ld, u64 keyidx); /* We've loaded peers from database, set them going. */ -void activate_peers(struct lightningd *ld); +void setup_peers(struct lightningd *ld); void drop_to_chain(struct lightningd *ld, struct channel *channel, bool cooperative); diff --git a/lightningd/test/run-find_my_abspath.c b/lightningd/test/run-find_my_abspath.c index 43c2593ff..a8805bce7 100644 --- a/lightningd/test/run-find_my_abspath.c +++ b/lightningd/test/run-find_my_abspath.c @@ -7,9 +7,6 @@ int unused_main(int argc, char *argv[]); #include /* AUTOGENERATED MOCKS START */ -/* Generated stub for activate_peers */ -void activate_peers(struct lightningd *ld UNNEEDED) -{ fprintf(stderr, "activate_peers called!\n"); abort(); } /* Generated stub for begin_topology */ void begin_topology(struct chain_topology *topo UNNEEDED) { fprintf(stderr, "begin_topology called!\n"); abort(); } @@ -191,6 +188,9 @@ void plugins_set_builtin_plugins_dir(struct plugins *plugins UNNEEDED, /* Generated stub for setup_color_and_alias */ void setup_color_and_alias(struct lightningd *ld UNNEEDED) { fprintf(stderr, "setup_color_and_alias called!\n"); abort(); } +/* Generated stub for setup_peers */ +void setup_peers(struct lightningd *ld UNNEEDED) +{ fprintf(stderr, "setup_peers called!\n"); abort(); } /* Generated stub for setup_topology */ void setup_topology(struct chain_topology *topology UNNEEDED, u32 min_blockheight UNNEEDED, u32 max_blockheight UNNEEDED)