@@ -767,9 +767,8 @@ where
767
767
/// very far in the past, and can only ever be up to two hours in the future.
768
768
highest_seen_timestamp : AtomicUsize ,
769
769
770
- /// The bulk of our storage will eventually be here (message queues and the like). Currently
771
- /// the `per_peer_state` stores our channels on a per-peer basis, as well as the peer's latest
772
- /// features.
770
+ /// The bulk of our storage. Currently the `per_peer_state` stores our channels on a per-peer
771
+ /// basis, as well as the peer's latest features.
773
772
///
774
773
/// If we are connected to a peer we always at least have an entry here, even if no channels
775
774
/// are currently open with that peer.
@@ -1220,7 +1219,7 @@ macro_rules! handle_error {
1220
1219
#[ cfg( any( feature = "_test_utils" , test) ) ]
1221
1220
{
1222
1221
if per_peer_state. get( & $counterparty_node_id) . is_none( ) {
1223
- // This shouldn't occour in tests unless an unkown counterparty_node_id
1222
+ // This shouldn't occur in tests unless an unknown counterparty_node_id
1224
1223
// has been passed to our message handling functions.
1225
1224
let expected_error_str = format!( "Can't find a peer matching the passed counterparty node_id {}" , $counterparty_node_id) ;
1226
1225
match err. action {
@@ -2255,7 +2254,8 @@ where
2255
2254
/// public, and thus should be called whenever the result is going to be passed out in a
2256
2255
/// [`MessageSendEvent::BroadcastChannelUpdate`] event.
2257
2256
///
2258
- /// May be called with peer_state already locked!
2257
+ /// Note that this function may be called without the `peer_state` corresponding to the passed
2258
+ /// channel's counterparty acquired, when the call site has full ownership of the channel.
2259
2259
fn get_channel_update_for_broadcast ( & self , chan : & Channel < <SP :: Target as SignerProvider >:: Signer > ) -> Result < msgs:: ChannelUpdate , LightningError > {
2260
2260
if !chan. should_announce ( ) {
2261
2261
return Err ( LightningError {
@@ -2274,7 +2274,8 @@ where
2274
2274
/// is public (only returning an Err if the channel does not yet have an assigned short_id),
2275
2275
/// and thus MUST NOT be called unless the recipient of the resulting message has already
2276
2276
/// provided evidence that they know about the existence of the channel.
2277
- /// May be called with peer_state already locked!
2277
+ /// Note that this function may be called without the `peer_state` corresponding to the passed
2278
+ /// channel's counterparty acquired, when the call site has full ownership of the channel.
2278
2279
fn get_channel_update_for_unicast ( & self , chan : & Channel < <SP :: Target as SignerProvider >:: Signer > ) -> Result < msgs:: ChannelUpdate , LightningError > {
2279
2280
log_trace ! ( self . logger, "Attempting to generate channel update for channel {}" , log_bytes!( chan. channel_id( ) ) ) ;
2280
2281
let short_channel_id = match chan. get_short_channel_id ( ) . or ( chan. latest_inbound_scid_alias ( ) ) {
@@ -3628,7 +3629,7 @@ where
3628
3629
fn fail_htlc_backwards_internal ( & self , source : & HTLCSource , payment_hash : & PaymentHash , onion_error : & HTLCFailReason , destination : HTLCDestination ) {
3629
3630
#[ cfg( any( feature = "_test_utils" , test) ) ]
3630
3631
{
3631
- // Ensure that no peer state channel storage lock is not held when calling this
3632
+ // Ensure that the peer state channel storage lock is not held when calling this
3632
3633
// function.
3633
3634
// This ensures that future code doesn't introduce a lock_order requirement for
3634
3635
// `forward_htlcs` to be locked after the `per_peer_state` peer locks, which calling
@@ -5539,7 +5540,8 @@ where
5539
5540
/// Note that that while `MessageSendEvent`s are strictly ordered per-peer, the peer order for
5540
5541
/// the chunks of `MessageSendEvent`s for different peers is random. I.e. if the array contains
5541
5542
/// `MessageSendEvent`s for both `node_a` and `node_b`, the `MessageSendEvent`s for `node_a`
5542
- /// will randomly be placed first or last in the returned array.
5543
+ /// will randomly be placed first or last in the returned array. Note that order will not be
5544
+ /// randomized with the `no-std` feature enabled.
5543
5545
///
5544
5546
/// Note that even though `BroadcastChannelAnnouncement` and `BroadcastChannelUpdate`
5545
5547
/// `MessageSendEvent`s are intended to be broadcasted to all peers, they will be pleaced among
0 commit comments