From b231db3f658f9256da3eb6c986689a1f5f1ee3ec Mon Sep 17 00:00:00 2001 From: Dusty Daemon Date: Wed, 30 Apr 2025 17:35:24 -0400 Subject: [PATCH] splice: Only send or recv commit sig if needed Be more conservative about when we request of send commit sig for splice to match the Eclair behavior. --- channeld/channeld.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/channeld/channeld.c b/channeld/channeld.c index 764d0788e..0c6c10c03 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -5296,7 +5296,8 @@ static void peer_reconnect(struct peer *peer, * indicate that we would like them to re-send * commitment signatures */ /* DTODO: Add bolt reference */ - send_next_commitment_number--; + if (!inflight->last_tx) + send_next_commitment_number--; } } @@ -5437,7 +5438,7 @@ static void peer_reconnect(struct peer *peer, status_info("Resuming splice negotation."); resume_splice_negotiation(peer, false, - true, + !inflight->last_tx, false, true); } else if (bitcoin_txid_eq(remote_next_funding, @@ -5450,8 +5451,8 @@ static void peer_reconnect(struct peer *peer, if (local_next_funding) assume_stfu_mode(peer); resume_splice_negotiation(peer, - true, - local_next_funding, + next_commitment_number == peer->next_index[REMOTE] - 1, + local_next_funding && !inflight->last_tx, true, local_next_funding); } else if (bitcoin_txid_eq(remote_next_funding, @@ -5615,7 +5616,10 @@ static void peer_reconnect(struct peer *peer, PRIu64, next_commitment_number); - retransmit_commitment_signed = true; + if (!recv_tlvs || !recv_tlvs->next_funding) + retransmit_commitment_signed = true; + else + retransmit_commitment_signed = false; /* BOLT #2: *