fixup! reestablish: Send announcement sigs when asked
What changed, and why it matters
This is a small code cleanup in Core Lightning's channel gossip handling. It changes two helper functions so they no longer return a true/false success value. The actual behavior—when to send announcement signatures and when to stop on errors—appears unchanged. The commit title says 'fixup!' which typically means it is polishing an earlier commit rather than fixing a new bug. There is no direct evidence this is a security fix.
Treat as a routine refactor unless the full series shows a caller depended on the removed boolean return. Review the parent commit(s) referenced by 'fixup! reestablish: Send announcement sigs when asked' to confirm no functional change was introduced. No immediate security response is warranted based on this diff alone.
Security signals we found
Function signature change from bool to void removes observable return values
Error paths no longer return early; control flow continues past channel_internal_error() calls
Commit is labeled 'fixup!' indicating it is a follow-up to a prior change
No explicit security relevance stated by vendor
No CVE, advisory, or researcher attribution present in supplied materials
Evidence from the diff
The patch refactors send_channel_announce_sigs() and send_channel_announce_sigs_once() from bool to void return type. It removes early ‘return false’ statements after logging or error conditions, replacing them with bare log/error calls. The callers of send_channel_announce_sigs_once() are not shown using the return value in this diff, and the function still sets cg->sent_sigs = true only after successfully building and sending the message. Because the diff is partial (only one file, no caller changes shown), we cannot confirm whether any caller previously relied on the boolean return value. The change looks like a follow-up style fix (‘fixup!’) to an earlier reestablish/announcement_signatures change.
Changed components
lightningd/channel_gossip.csend_channel_announce_sigs()send_channel_announce_sigs_once()channel announcement signature sending logicInspect captured patch +8 / −14
diff --git a/lightningd/channel_gossip.c b/lightningd/channel_gossip.c
index fcd31c7d..d8dab441 100644
--- a/lightningd/channel_gossip.c
+++ b/lightningd/channel_gossip.c
@@ -687,7 +687,7 @@ static void stash_remote_announce_sigs(struct channel *channel,
* - MUST NOT send the `announcement_signatures` message.
*/
-static bool send_channel_announce_sigs(struct channel *channel)
+static void send_channel_announce_sigs(struct channel *channel)
{
/* First 2 + 256 byte are the signatures and msg type, skip them */
const size_t offset = 258;
@@ -698,10 +698,8 @@ static bool send_channel_announce_sigs(struct channel *channel)
const u8 *ca, *msg;
/* Wait until we've exchanged reestablish messages */
- if (!channel->reestablished) {
+ if (!channel->reestablished)
log_debug(channel->log, "channel_gossip: not sending channel_announcement_sigs until reestablished");
- return false;
- }
ca = create_channel_announcement(tmpctx, channel, *channel->scid,
NULL, NULL, NULL, NULL);
@@ -716,33 +714,29 @@ static bool send_channel_announce_sigs(struct channel *channel)
/* Double-check that HSM gave valid signatures. */
sha256_double(&hash, ca + offset, tal_count(ca) - offset);
- if (!check_signed_hash(&hash, &local_node_sig, &ld->our_pubkey)) {
+ if (!check_signed_hash(&hash, &local_node_sig, &ld->our_pubkey))
channel_internal_error(channel,
"HSM returned an invalid node signature");
- return false;
- }
- if (!check_signed_hash(&hash, &local_bitcoin_sig, &channel->local_funding_pubkey)) {
+ if (!check_signed_hash(&hash, &local_bitcoin_sig, &channel->local_funding_pubkey))
channel_internal_error(channel,
"HSM returned an invalid bitcoin signature");
- return false;
- }
msg = towire_announcement_signatures(NULL,
&channel->cid, *channel->scid,
&local_node_sig, &local_bitcoin_sig);
msg_to_peer(channel->peer, take(msg));
- return cg->sent_sigs = true;
+ cg->sent_sigs = true;
}
-static bool send_channel_announce_sigs_once(struct channel *channel)
+static void send_channel_announce_sigs_once(struct channel *channel)
{
struct channel_gossip *cg = channel->channel_gossip;
if (cg->sent_sigs)
- return false;
+ return;
- return send_channel_announce_sigs(channel);
+ send_channel_announce_sigs(channel);
}
/* Sends channel_announcement */
Why this scored 23/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.