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