Skip to content

Commit 80f0b1b

Browse files
jkczyzAnyitechs
authored andcommitted
Retransmit commitment_signed before tx_signatures
During channel reestablishment, both commitment_signed and tx_signatures messages may be retransmitted. However, commitment_signed must come first, so re-arrange the ordering. This moves tx_abort as well to keep the interactive tx messages together.
1 parent 7ab1580 commit 80f0b1b

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8939,19 +8939,6 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
89398939
msg,
89408940
});
89418941
}
8942-
// TODO(dual_funding): For async signing support we need to hold back `tx_signatures` until the `commitment_signed` is ready.
8943-
if let Some(msg) = tx_signatures {
8944-
pending_msg_events.push(MessageSendEvent::SendTxSignatures {
8945-
node_id: counterparty_node_id,
8946-
msg,
8947-
});
8948-
}
8949-
if let Some(msg) = tx_abort {
8950-
pending_msg_events.push(MessageSendEvent::SendTxAbort {
8951-
node_id: counterparty_node_id,
8952-
msg,
8953-
});
8954-
}
89558942

89568943
macro_rules! handle_cs { () => {
89578944
if let Some(update) = commitment_update {
@@ -8981,6 +8968,20 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
89818968
},
89828969
}
89838970

8971+
// TODO(dual_funding): For async signing support we need to hold back `tx_signatures` until the `commitment_signed` is ready.
8972+
if let Some(msg) = tx_signatures {
8973+
pending_msg_events.push(MessageSendEvent::SendTxSignatures {
8974+
node_id: counterparty_node_id,
8975+
msg,
8976+
});
8977+
}
8978+
if let Some(msg) = tx_abort {
8979+
pending_msg_events.push(MessageSendEvent::SendTxAbort {
8980+
node_id: counterparty_node_id,
8981+
msg,
8982+
});
8983+
}
8984+
89848985
if let Some(tx) = funding_broadcastable {
89858986
if channel.context.is_manual_broadcast() {
89868987
log_info!(logger, "Not broadcasting funding transaction with txid {} as it is manually managed", tx.compute_txid());

0 commit comments

Comments
 (0)