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