@@ -743,9 +743,8 @@ where
743
743
/// very far in the past, and can only ever be up to two hours in the future.
744
744
highest_seen_timestamp : AtomicUsize ,
745
745
746
- /// The bulk of our storage will eventually be here (message queues and the like). Currently
747
- /// the `per_peer_state` stores our channels on a per-peer basis, as well as the peer's latest
748
- /// features.
746
+ /// The bulk of our storage. Currently the `per_peer_state` stores our channels on a per-peer
747
+ /// basis, as well as the peer's latest features.
749
748
///
750
749
/// If we are connected to a peer we always at least have an entry here, even if no channels
751
750
/// are currently open with that peer.
@@ -1196,7 +1195,7 @@ macro_rules! handle_error {
1196
1195
#[ cfg( debug_assertions) ]
1197
1196
{
1198
1197
if per_peer_state. get( & $counterparty_node_id) . is_none( ) {
1199
- // This shouldn't occour in tests unless an unkown counterparty_node_id
1198
+ // This shouldn't occur in tests unless an unknown counterparty_node_id
1200
1199
// has been passed to our message handling functions.
1201
1200
let expected_error_str = format!( "Can't find a peer matching the passed counterparty node_id {}" , $counterparty_node_id) ;
1202
1201
match err. action {
@@ -2229,7 +2228,8 @@ where
2229
2228
/// public, and thus should be called whenever the result is going to be passed out in a
2230
2229
/// [`MessageSendEvent::BroadcastChannelUpdate`] event.
2231
2230
///
2232
- /// May be called with peer_state already locked!
2231
+ /// Note that this function may be called without the `peer_state` corresponding to the passed
2232
+ /// channel's counterparty acquired, when the call site has full ownership of the channel.
2233
2233
fn get_channel_update_for_broadcast ( & self , chan : & Channel < <SP :: Target as SignerProvider >:: Signer > ) -> Result < msgs:: ChannelUpdate , LightningError > {
2234
2234
if !chan. should_announce ( ) {
2235
2235
return Err ( LightningError {
@@ -2248,7 +2248,8 @@ where
2248
2248
/// is public (only returning an Err if the channel does not yet have an assigned short_id),
2249
2249
/// and thus MUST NOT be called unless the recipient of the resulting message has already
2250
2250
/// provided evidence that they know about the existence of the channel.
2251
- /// May be called with peer_state already locked!
2251
+ /// Note that this function may be called without the `peer_state` corresponding to the passed
2252
+ /// channel's counterparty acquired, when the call site has full ownership of the channel.
2252
2253
fn get_channel_update_for_unicast ( & self , chan : & Channel < <SP :: Target as SignerProvider >:: Signer > ) -> Result < msgs:: ChannelUpdate , LightningError > {
2253
2254
log_trace ! ( self . logger, "Attempting to generate channel update for channel {}" , log_bytes!( chan. channel_id( ) ) ) ;
2254
2255
let short_channel_id = match chan. get_short_channel_id ( ) . or ( chan. latest_inbound_scid_alias ( ) ) {
@@ -3553,7 +3554,7 @@ where
3553
3554
fn fail_htlc_backwards_internal ( & self , source : & HTLCSource , payment_hash : & PaymentHash , onion_error : & HTLCFailReason , destination : HTLCDestination ) {
3554
3555
#[ cfg( debug_assertions) ]
3555
3556
{
3556
- // Ensure that no peer state channel storage lock is not held when calling this
3557
+ // Ensure that the peer state channel storage lock is not held when calling this
3557
3558
// function.
3558
3559
// This ensures that future code doesn't introduce a lock_order requirement for
3559
3560
// `forward_htlcs` to be locked after the `per_peer_state` peer locks, which calling
@@ -5452,7 +5453,8 @@ where
5452
5453
/// Note that that while `MessageSendEvent`s are strictly ordered per-peer, the peer order for
5453
5454
/// the chunks of `MessageSendEvent`s for different peers is random. I.e. if the array contains
5454
5455
/// `MessageSendEvent`s for both `node_a` and `node_b`, the `MessageSendEvent`s for `node_a`
5455
- /// will randomly be placed first or last in the returned array.
5456
+ /// will randomly be placed first or last in the returned array. Note that order will not be
5457
+ /// randomized with the `no-std` feature enabled.
5456
5458
///
5457
5459
/// Note that even though `BroadcastChannelAnnouncement` and `BroadcastChannelUpdate`
5458
5460
/// `MessageSendEvent`s are intended to be broadcasted to all peers, they will be pleaced among
0 commit comments