Skip to content

Commit e563b9d

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 not 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 accrodance with the Interactive Transaction Construction specification: https://github.com/lightning/bolts/blob/aa5207aea/02-peer-protocol.md?plain=1#L404
1 parent 8130b69 commit e563b9d

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

lightning/src/ln/interactivetxs.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ impl InteractiveTxSigningSession {
342342
/// unsigned transaction.
343343
pub fn provide_holder_witnesses(
344344
&mut self, channel_id: ChannelId, witnesses: Vec<Witness>,
345-
) -> Result<Option<TxSignatures>, ()> {
345+
) -> Result<(), ()> {
346346
if self.local_inputs_count() != witnesses.len() {
347347
return Err(());
348348
}
@@ -354,13 +354,8 @@ impl InteractiveTxSigningSession {
354354
witnesses: witnesses.into_iter().collect(),
355355
shared_input_signature: None,
356356
});
357-
if self.received_commitment_signed
358-
&& (self.holder_sends_tx_signatures_first || self.counterparty_sent_tx_signatures)
359-
{
360-
Ok(self.holder_tx_signatures.clone())
361-
} else {
362-
Ok(None)
363-
}
357+
358+
Ok(())
364359
}
365360

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

0 commit comments

Comments
 (0)