Skip to content

Commit 5a13036

Browse files
committed
Introduce interactive signing state flags
This intoduces the INTERACTIVE_SIGNING, THEIR_TX_SIGNATURES_SENT, and OUR_TX_SIGNATURES_SENT funded state flags. A top-level state flag for INTERACTIVE_SIGNING was avoided so that this work is compatible with splicing as well as V2 channel establishment (dual-funding). This commit also ensures that `ChannelPending` is only emitted after peers exchange `tx_signatures`.
1 parent 4ba3d9f commit 5a13036

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

lightning/src/ln/channel.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2630,10 +2630,7 @@ impl<SP: Deref> PendingV2Channel<SP> where SP::Target: SignerProvider {
26302630
self.context.assert_no_commitment_advancement(transaction_number, "initial commitment_signed");
26312631
let commitment_signed = self.context.get_initial_commitment_signed(&self.funding, logger);
26322632
let commitment_signed = match commitment_signed {
2633-
Ok(commitment_signed) => {
2634-
self.funding.funding_transaction = Some(signing_session.unsigned_tx().build_unsigned_tx());
2635-
commitment_signed
2636-
},
2633+
Ok(commitment_signed) => commitment_signed,
26372634
Err(err) => {
26382635
self.funding.channel_transaction_parameters.funding_outpoint = None;
26392636
return Err(ChannelError::Close((err.to_string(), ClosureReason::HolderForceClosed { broadcasted_latest_txn: Some(false) })));
@@ -6711,10 +6708,8 @@ impl<SP: Deref> FundedChannel<SP> where
67116708
self.context.channel_state.set_their_tx_signatures_sent();
67126709

67136710
if funding_tx_opt.is_some() {
6714-
// We have a finalized funding transaction, so we can set the funding transaction and reset the
6715-
// signing session fields.
6711+
// We have a finalized funding transaction, so we can set the funding transaction.
67166712
self.funding.funding_transaction = funding_tx_opt.clone();
6717-
self.interactive_tx_signing_session = None;
67186713
}
67196714

67206715
// Note that `holder_tx_signatures_opt` will be `None` if we sent `tx_signatures` first, so this

lightning/src/ln/interactivetxs.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -353,14 +353,6 @@ impl InteractiveTxSigningSession {
353353
}
354354
}
355355

356-
pub fn get_tx_signatures(&self) -> Option<TxSignatures> {
357-
if self.has_received_commitment_signed {
358-
self.holder_tx_signatures.clone()
359-
} else {
360-
None
361-
}
362-
}
363-
364356
/// Handles a `tx_signatures` message received from the counterparty.
365357
///
366358
/// If the holder is required to send their `tx_signatures` message and these signatures have

0 commit comments

Comments
 (0)