@@ -721,6 +721,8 @@ pub struct ChannelManager<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref,
721
721
/// after reloading from disk while replaying blocks against ChannelMonitors.
722
722
///
723
723
/// See `PendingOutboundPayment` documentation for more info.
724
+ ///
725
+ /// See `ChannelManager` struct-level documentation for lock order requirements.
724
726
pending_outbound_payments : Mutex < HashMap < PaymentId , PendingOutboundPayment > > ,
725
727
726
728
/// SCID/SCID Alias -> forward infos. Key of 0 means payments received.
@@ -731,6 +733,8 @@ pub struct ChannelManager<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref,
731
733
///
732
734
/// Note that no consistency guarantees are made about the existence of a channel with the
733
735
/// `short_channel_id` here, nor the `short_channel_id` in the `PendingHTLCInfo`!
736
+ ///
737
+ /// See `ChannelManager` struct-level documentation for lock order requirements.
734
738
#[ cfg( test) ]
735
739
pub ( super ) forward_htlcs : Mutex < HashMap < u64 , Vec < HTLCForwardInfo > > > ,
736
740
#[ cfg( not( test) ) ]
@@ -759,6 +763,8 @@ pub struct ChannelManager<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref,
759
763
/// We should add `counterparty_node_id`s to `MonitorEvent`s, and eventually rely on it in the
760
764
/// future. That would make this map redundant, as only the `ChannelManager::per_peer_state` is
761
765
/// required to access the channel with the `counterparty_node_id`.
766
+ ///
767
+ /// See `ChannelManager` struct-level documentation for lock order requirements.
762
768
id_to_peer : Mutex < HashMap < [ u8 ; 32 ] , PublicKey > > ,
763
769
764
770
our_network_key : SecretKey ,
@@ -789,10 +795,13 @@ pub struct ChannelManager<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref,
789
795
/// Because adding or removing an entry is rare, we usually take an outer read lock and then
790
796
/// operate on the inner value freely. Sadly, this prevents parallel operation when opening a
791
797
/// new channel.
798
+ ///
799
+ /// See `ChannelManager` struct-level documentation for lock order requirements.
792
800
per_peer_state : RwLock < HashMap < PublicKey , Mutex < PeerState > > > ,
793
801
802
+ /// See `ChannelManager` struct-level documentation for lock order requirements.
794
803
pending_events : Mutex < Vec < events:: Event > > ,
795
-
804
+ /// See `ChannelManager` struct-level documentation for lock order requirements.
796
805
pending_background_events : Mutex < Vec < BackgroundEvent > > ,
797
806
/// Used when we have to take a BIG lock to make sure everything is self-consistent.
798
807
/// Essentially just when we're serializing ourselves out.
0 commit comments