Skip to content

Commit 4ba3d9f

Browse files
committed
Handle receiving channel_reestablish with next_funding_txid
This follows the the specification closely in branching without being too verbose, so that it should be easy to follow the logic. See: https://github.com/lightning/bolts/blob/aa5207a/02-peer-protocol.md?plain=1#L2520-L2531
1 parent 4038bbf commit 4ba3d9f

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

lightning/src/ln/channel.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2630,7 +2630,10 @@ 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) => commitment_signed,
2633+
Ok(commitment_signed) => {
2634+
self.funding.funding_transaction = Some(signing_session.unsigned_tx().build_unsigned_tx());
2635+
commitment_signed
2636+
},
26342637
Err(err) => {
26352638
self.funding.channel_transaction_parameters.funding_outpoint = None;
26362639
return Err(ChannelError::Close((err.to_string(), ClosureReason::HolderForceClosed { broadcasted_latest_txn: Some(false) })));

lightning/src/ln/interactivetxs.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,14 @@ 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+
356364
/// Handles a `tx_signatures` message received from the counterparty.
357365
///
358366
/// If the holder is required to send their `tx_signatures` message and these signatures have

0 commit comments

Comments
 (0)