@@ -245,52 +245,52 @@ enum HTLCUpdateAwaitingACK {
245
245
}
246
246
247
247
/// There are a few "states" and then a number of flags which can be applied:
248
- /// We first move through init with OurInitSent -> TheirInitSent -> FundingCreated -> FundingSent.
249
- /// TheirChannelReady and OurChannelReady then get set on FundingSent, and when both are set we
250
- /// move on to ChannelReady.
251
- /// Note that PeerDisconnected can be set on both ChannelReady and FundingSent.
252
- /// ChannelReady can then get all remaining flags set on it, until we finish shutdown, then we
253
- /// move on to ShutdownComplete, at which point most calls into this channel are disallowed.
248
+ /// We first move through init with ` OurInitSent` -> ` TheirInitSent` -> ` FundingCreated` -> ` FundingSent` .
249
+ /// ` TheirChannelReady` and ` OurChannelReady` then get set on ` FundingSent` , and when both are set we
250
+ /// move on to ` ChannelReady` .
251
+ /// Note that ` PeerDisconnected` can be set on both ` ChannelReady` and ` FundingSent` .
252
+ /// ` ChannelReady` can then get all remaining flags set on it, until we finish shutdown, then we
253
+ /// move on to ` ShutdownComplete` , at which point most calls into this channel are disallowed.
254
254
enum ChannelState {
255
255
/// Implies we have (or are prepared to) send our open_channel/accept_channel message
256
256
OurInitSent = 1 << 0 ,
257
- /// Implies we have received their open_channel/ accept_channel message
257
+ /// Implies we have received their ` open_channel`/` accept_channel` message
258
258
TheirInitSent = 1 << 1 ,
259
- /// We have sent funding_created and are awaiting a funding_signed to advance to FundingSent.
260
- /// Note that this is nonsense for an inbound channel as we immediately generate funding_signed
261
- /// upon receipt of funding_created, so simply skip this state.
259
+ /// We have sent ` funding_created` and are awaiting a ` funding_signed` to advance to ` FundingSent` .
260
+ /// Note that this is nonsense for an inbound channel as we immediately generate ` funding_signed`
261
+ /// upon receipt of ` funding_created` , so simply skip this state.
262
262
FundingCreated = 4 ,
263
- /// Set when we have received/sent funding_created and funding_signed and are thus now waiting
264
- /// on the funding transaction to confirm. The ChannelReady flags are set to indicate when we
263
+ /// Set when we have received/sent ` funding_created` and ` funding_signed` and are thus now waiting
264
+ /// on the funding transaction to confirm. The ` ChannelReady` flags are set to indicate when we
265
265
/// and our counterparty consider the funding transaction confirmed.
266
266
FundingSent = 8 ,
267
- /// Flag which can be set on FundingSent to indicate they sent us a channel_ready message.
268
- /// Once both TheirChannelReady and OurChannelReady are set, state moves on to ChannelReady.
267
+ /// Flag which can be set on ` FundingSent` to indicate they sent us a ` channel_ready` message.
268
+ /// Once both ` TheirChannelReady` and ` OurChannelReady` are set, state moves on to ` ChannelReady` .
269
269
TheirChannelReady = 1 << 4 ,
270
- /// Flag which can be set on FundingSent to indicate we sent them a channel_ready message.
271
- /// Once both TheirChannelReady and OurChannelReady are set, state moves on to ChannelReady.
270
+ /// Flag which can be set on ` FundingSent` to indicate we sent them a ` channel_ready` message.
271
+ /// Once both ` TheirChannelReady` and ` OurChannelReady` are set, state moves on to ` ChannelReady` .
272
272
OurChannelReady = 1 << 5 ,
273
273
ChannelReady = 64 ,
274
- /// Flag which is set on ChannelReady and FundingSent indicating remote side is considered
275
- /// "disconnected" and no updates are allowed until after we've done a channel_reestablish
274
+ /// Flag which is set on ` ChannelReady` and ` FundingSent` indicating remote side is considered
275
+ /// "disconnected" and no updates are allowed until after we've done a ` channel_reestablish`
276
276
/// dance.
277
277
PeerDisconnected = 1 << 7 ,
278
- /// Flag which is set on ChannelReady, FundingCreated, and FundingSent indicating the user has
279
- /// told us a ChannelMonitor update is pending async persistence somewhere and we should pause
278
+ /// Flag which is set on ` ChannelReady` , FundingCreated, and ` FundingSent` indicating the user has
279
+ /// told us a ` ChannelMonitor` update is pending async persistence somewhere and we should pause
280
280
/// sending any outbound messages until they've managed to finish.
281
281
MonitorUpdateInProgress = 1 << 8 ,
282
282
/// Flag which implies that we have sent a commitment_signed but are awaiting the responding
283
283
/// revoke_and_ack message. During this time period, we can't generate new commitment_signed
284
284
/// messages as then we will be unable to determine which HTLCs they included in their
285
285
/// revoke_and_ack implicit ACK, so instead we have to hold them away temporarily to be sent
286
286
/// later.
287
- /// Flag is set on ChannelReady.
287
+ /// Flag is set on ` ChannelReady` .
288
288
AwaitingRemoteRevoke = 1 << 9 ,
289
- /// Flag which is set on ChannelReady or FundingSent after receiving a shutdown message from
289
+ /// Flag which is set on ` ChannelReady` or ` FundingSent` after receiving a shutdown message from
290
290
/// the remote end. If set, they may not add any new HTLCs to the channel, and we are expected
291
291
/// to respond with our own shutdown message when possible.
292
292
RemoteShutdownSent = 1 << 10 ,
293
- /// Flag which is set on ChannelReady or FundingSent after sending a shutdown message. At this
293
+ /// Flag which is set on ` ChannelReady` or ` FundingSent` after sending a shutdown message. At this
294
294
/// point, we may not add any new HTLCs to the channel.
295
295
LocalShutdownSent = 1 << 11 ,
296
296
/// We've successfully negotiated a closing_signed dance. At this point ChannelManager is about
@@ -4565,9 +4565,11 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
4565
4565
& self . channel_type
4566
4566
}
4567
4567
4568
- /// Guaranteed to be Some after both ChannelReady messages have been exchanged (and, thus,
4569
- /// is_usable() returns true).
4568
+ /// Guaranteed to be [` Some`] after both [`ChannelState:: ChannelReady`] messages have been exchanged
4569
+ /// (and, thus, [` is_usable()`] returns true).
4570
4570
/// Allowed in any state (including after shutdown)
4571
+ ///
4572
+ /// [`is_usable()`]: Self::is_usable
4571
4573
pub fn get_short_channel_id ( & self ) -> Option < u64 > {
4572
4574
self . short_channel_id
4573
4575
}
@@ -5401,14 +5403,16 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
5401
5403
}
5402
5404
5403
5405
/// Gets an UnsignedChannelAnnouncement for this channel. The channel must be publicly
5404
- /// announceable and available for use (have exchanged ChannelReady messages in both
5406
+ /// announceable and available for use (have exchanged [` ChannelReady`] messages in both
5405
5407
/// directions). Should be used for both broadcasted announcements and in response to an
5406
5408
/// AnnouncementSignatures message from the remote peer.
5407
5409
///
5408
5410
/// Will only fail if we're not in a state where channel_announcement may be sent (including
5409
5411
/// closing).
5410
5412
///
5411
5413
/// This will only return ChannelError::Ignore upon failure.
5414
+ ///
5415
+ /// [`ChannelReady`]: crate::ln::msgs::ChannelReady
5412
5416
fn get_channel_announcement < NS : Deref > (
5413
5417
& self , node_signer : & NS , chain_hash : BlockHash , user_config : & UserConfig ,
5414
5418
) -> Result < msgs:: UnsignedChannelAnnouncement , ChannelError > where NS :: Target : NodeSigner {
0 commit comments