From 73e325ca1241ace1d532077198b458901ff1dc7f Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 7 Feb 2022 14:02:32 +1030 Subject: [PATCH] misc: clarifications from cdecker review. Signed-off-by: Rusty Russell --- connectd/multiplex.h | 2 +- gossipd/gossip_generation.c | 6 ++++++ gossipd/gossipd.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/connectd/multiplex.h b/connectd/multiplex.h index 13c37e298221..1c87ccb59a35 100644 --- a/connectd/multiplex.h +++ b/connectd/multiplex.h @@ -22,7 +22,7 @@ void multiplex_final_msg(struct peer *peer, const u8 *final_msg TAKES); /* Inject a message into the output stream. Unlike a raw msg_enqueue, - * this does io logging if required. */ + * this does io logging. */ void inject_peer_msg(struct peer *peer, const u8 *msg TAKES); void setup_peer_gossip_store(struct peer *peer, diff --git a/gossipd/gossip_generation.c b/gossipd/gossip_generation.c index 70b8f854b15f..e7c9e8e01e42 100644 --- a/gossipd/gossip_generation.c +++ b/gossipd/gossip_generation.c @@ -821,6 +821,12 @@ void handle_used_local_channel_update(struct daemon *daemon, const u8 *msg) &scid)); return; } + + /* This whole idea is racy: they might have used a *previous* update. + * But that's OK: the notification is an optimization to avoid + * broadcasting updates we never use (route flapping). In this case, + * we might broadcast a more recent update than the one we sent to a + * peer. */ local_channel_update_latest(daemon, chan); } diff --git a/gossipd/gossipd.c b/gossipd/gossipd.c index 6113dc8cae87..4b607afb7f50 100644 --- a/gossipd/gossipd.c +++ b/gossipd/gossipd.c @@ -442,7 +442,7 @@ static void handle_recv_gossip(struct daemon *daemon, const u8 *outermsg) peer = find_peer(daemon, &id); if (!peer) { - status_broken("connectd sent gossip msg %s for unknown peer %s", + status_broken("connectd sent gossip msg %s from unknown peer %s", peer_wire_name(fromwire_peektype(msg)), type_to_string(tmpctx, struct node_id, &id)); return;