Skip to content

Commit 8c318ff

Browse files
committed
Return early on duplicate calls to funding_transaction_signed
We may produce duplicate `FundingTransactionReadyForSigning` events if the user has processed an initial event but has not yet called back with `funding_transaction_signed` and a peer reconnection occurs. If the user also handles the duplicate events, any duplicate calls to `funding_transaction_signed` after an initial successful one would return an error. This doesn't make sense, as the API should remain idempotent, so we return early on any duplicate calls.
1 parent 3e21ba3 commit 8c318ff

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lightning/src/ln/channel.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8605,6 +8605,12 @@ where
86058605
.unwrap_or(false));
86068606
}
86078607

8608+
if signing_session.holder_tx_signatures().is_some() {
8609+
// Our `tx_signatures` either should've been the first time we processed them,
8610+
// or we're waiting for our counterparty to send theirs first.
8611+
return Ok((None, None));
8612+
}
8613+
86088614
signing_session
86098615
} else {
86108616
let err =

0 commit comments

Comments
 (0)