Skip to content

Commit c4e7eca

Browse files
committed
s/Option<TxSignatures>/() for return from provide_holder_witnesses
In a following commit we change the state at which a V2 channel is promoted to a `Channel` (after monitor persistence) to avoid a crash upon reading a `Channel` with no corresponding monitor persisted. This means that we will have no need for an optional (based on signing order) `TxSignatures` being returned when `provide_holder_witnesses` is called. The above is also the reason for removing the `received_commitment_signed` and signing order checks in the body of `provide_holder_witnesses`. These checks will only be important when we actually contribute inputs. Currently, we don't so we always send `tx_signatures` first in accordance with the Interactive Transaction Construction specification: https://github.com/lightning/bolts/blob/aa5207aea/02-peer-protocol.md?plain=1#L404
1 parent 6da9ef4 commit c4e7eca

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

lightning/src/ln/interactivetxs.rs

+3-8
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ impl InteractiveTxSigningSession {
358358
/// unsigned transaction.
359359
pub fn provide_holder_witnesses(
360360
&mut self, channel_id: ChannelId, witnesses: Vec<Witness>,
361-
) -> Result<Option<TxSignatures>, ()> {
361+
) -> Result<(), ()> {
362362
if self.local_inputs_count() != witnesses.len() {
363363
return Err(());
364364
}
@@ -370,13 +370,8 @@ impl InteractiveTxSigningSession {
370370
witnesses: witnesses.into_iter().collect(),
371371
shared_input_signature: None,
372372
});
373-
if self.received_commitment_signed
374-
&& (self.holder_sends_tx_signatures_first || self.counterparty_sent_tx_signatures)
375-
{
376-
Ok(self.holder_tx_signatures.clone())
377-
} else {
378-
Ok(None)
379-
}
373+
374+
Ok(())
380375
}
381376

382377
pub fn remote_inputs_count(&self) -> usize {

0 commit comments

Comments
 (0)