Skip to content

Commit 1015543

Browse files
committed
f update docs some to fix old mentions and clarify to not broadcast
1 parent 3e4fd4f commit 1015543

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

lightning/src/ln/channel.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2781,14 +2781,14 @@ impl<Signer: Sign> Channel<Signer> {
27812781
self.funding_transaction.take()
27822782
} else { None };
27832783

2784-
// Because we will never generate a FundingBroadcastSafe event when we're in
2785-
// MonitorUpdateFailed, if we assume the user only broadcast the funding transaction when
2786-
// they received the FundingBroadcastSafe event, we can only ever hit
2784+
// Because we will never broadcast the funding transaction when we're in
2785+
// MonitorUpdateFailed, if we assume the user never directly broadcasts the funding
2786+
// transaction and waits for us to do it, we can only ever hit
27872787
// monitor_pending_funding_locked when we're an inbound channel which failed to persist the
27882788
// monitor on funding_created, and we even got the funding transaction confirmed before the
27892789
// monitor was persisted.
27902790
let funding_locked = if self.monitor_pending_funding_locked {
2791-
assert!(!self.is_outbound(), "Funding transaction broadcast without FundingBroadcastSafe!");
2791+
assert!(!self.is_outbound(), "Funding transaction broadcast manually - we didn't do it!");
27922792
self.monitor_pending_funding_locked = false;
27932793
let next_per_commitment_point = self.holder_signer.get_per_commitment_point(self.cur_holder_commitment_transaction_number, &self.secp_ctx);
27942794
Some(msgs::FundingLocked {

lightning/src/ln/channelmanager.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -851,10 +851,11 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
851851

852852
/// Creates a new outbound channel to the given remote node and with the given value.
853853
///
854-
/// user_id will be provided back as user_channel_id in FundingGenerationReady and
855-
/// FundingBroadcastSafe events to allow tracking of which events correspond with which
856-
/// create_channel call. Note that user_channel_id defaults to 0 for inbound channels, so you
857-
/// may wish to avoid using 0 for user_id here.
854+
/// user_id will be provided back as user_channel_id in FundingGenerationReady events to allow
855+
/// tracking of which events correspond with which create_channel call. Note that the
856+
/// user_channel_id defaults to 0 for inbound channels, so you may wish to avoid using 0 for
857+
/// user_id here. user_id has no meaning inside of LDK, it is simply copied to events and
858+
/// otherwise ignored.
858859
///
859860
/// If successful, will generate a SendOpenChannel message event, so you should probably poll
860861
/// PeerManager::process_events afterwards.
@@ -1536,6 +1537,10 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
15361537
///
15371538
/// May panic if the funding_txo is duplicative with some other channel (note that this should
15381539
/// be trivially prevented by using unique funding transaction keys per-channel).
1540+
///
1541+
/// Do NOT broadcast the funding transaction yourself. When we have safely received our
1542+
/// counterparty's signature the funding transaction will automatically be broadcast via the
1543+
/// [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
15391544
pub fn funding_transaction_generated(&self, temporary_channel_id: &[u8; 32], funding_transaction: Transaction, output_index: u16) -> Result<(), APIError> {
15401545
let _persistence_guard = PersistenceNotifierGuard::new(&self.total_consistency_lock, &self.persistence_notifier);
15411546

0 commit comments

Comments
 (0)