Skip to content

Commit f5b7288

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 7456483 commit f5b7288

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
@@ -8617,6 +8617,12 @@ where
86178617
.unwrap_or(false));
86188618
}
86198619

8620+
if signing_session.holder_tx_signatures().is_some() {
8621+
// Our `tx_signatures` either should've been the first time we processed them,
8622+
// or we're waiting for our counterparty to send theirs first.
8623+
return Ok((None, None));
8624+
}
8625+
86208626
signing_session
86218627
} else {
86228628
let err =

0 commit comments

Comments
 (0)