lightningd: remember that we've sent tx_signatures for an open
What changed, and why it matters
This commit adds a small bookkeeping flag so the Core Lightning node remembers whether it has already sent transaction signatures while opening a channel. The commit message explicitly says there is 'No behavior change... yet,' meaning this is a preparatory patch for a future fix rather than a security fix itself. It does not change how funds are handled today.
No immediate action is required for this commit alone. Monitor the follow-up commits that consume channel_funding_sigs_sent() to ensure the promised BOLT #2 tx_abort rule is correctly enforced, because the security relevance depends on that future logic.
Security signals we found
New state flag tracks whether tx_signatures have been sent for a funding transaction
Comment references BOLT #2 tx_abort receiver rule, suggesting future safety enforcement
Persistence added via wallet_inflight_save() so the flag survives restart
Commit message states 'No behavior change... yet' indicating preparatory work
Evidence from the diff
The patch introduces channel_funding_sigs_sent(), an accessor that returns the new i_sent_sigs flag on the current channel_inflight. In dual_open_control.c, when the dualopend subdaemon reports that our tx_signatures have been sent to the peer, the flag is set and persisted via wallet_inflight_save(). A code comment references BOLT #2’s tx_abort receiver rule, implying the flag will later be used to enforce that a channel cannot be forgotten once signatures have been sent until a funding input is spent. The actual enforcement is not present in this commit.
Changed components
lightningd/channel.clightningd/channel.hlightningd/dual_open_control.cstruct channel_inflightInspect captured patch +15 / −0
### lightningd/channel.c
@@ -1193,6 +1193,12 @@ channel_current_inflight(const struct channel *channel)
struct channel_inflight, list);
}
+bool channel_funding_sigs_sent(const struct channel *channel)
+{
+ struct channel_inflight *inflight = channel_current_inflight(channel);
+ return inflight && inflight->i_sent_sigs;
+}
+
u32 channel_last_funding_feerate(const struct channel *channel)
{
struct channel_inflight *inflight;
### lightningd/channel.h
@@ -502,6 +502,9 @@ struct channel_inflight *channel_inflight_find(struct channel *channel,
struct channel_inflight *
channel_current_inflight(const struct channel *channel);
+/* True if we have already sent tx_signatures for the current inflight. */
+bool channel_funding_sigs_sent(const struct channel *channel);
+
/* What's the last feerate used for a funding tx on this channel? */
u32 channel_last_funding_feerate(const struct channel *channel);
### lightningd/dual_open_control.c
@@ -1800,6 +1800,12 @@ static void handle_peer_tx_sigs_sent(struct subd *dualopend,
return;
}
+ /* Once we have sent tx_signatures we must not forget the channel
+ * until an input of the negotiated tx is spent (BOLT #2 tx_abort
+ * receiver rule). */
+ inflight->i_sent_sigs = true;
+ wallet_inflight_save(dualopend->ld->wallet, inflight);
+
/* Once we've sent our sigs to the peer, we're fine
* to broadcast the transaction, even if they haven't
* sent us their tx-sigs yet. They're not allowed toWhy this scored 28/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.