@@ -670,27 +670,33 @@ pub type SimpleRefChannelManager<'a, 'b, 'c, 'd, 'e, M, T, F, L> = ChannelManage
670
670
//
671
671
// Lock order:
672
672
// The tree structure below illustrates the lock order requirements for the different locks of the
673
- // `ChannelManager`. If two or more locks on the same branch is held at the same time, locks should
674
- // be taken in the order of the lowest to highest level in the tree.
673
+ // `ChannelManager`. If two or more locks on the same branch are held at the same time, locks
674
+ // should be taken in the order of the lowest to the highest level in the tree.
675
675
//
676
676
// Lock order tree:
677
- // │
678
- // │──`channel_state`
679
- // │ │
680
- // │ │──`id_to_peer`
681
- // │ │
682
- // │ └──`per_peer_state`
683
- // │ │
684
- // │ │──`best_block`
685
- // │ │
686
- // │ └──`pending_inbound_payments`
687
- // │ │
688
- // │ └──`pending_outbound_payments`
689
- // │ │
690
- // │ └──`pending_events`
691
- // │ │
692
- // │ └──`pending_background_events`
693
- // │
677
+ //
678
+ // `total_consistency_lock`
679
+ // │
680
+ // │──`forward_htlcs`
681
+ // │
682
+ // │──`channel_state`
683
+ // │ │
684
+ // │ │──`id_to_peer`
685
+ // │ │
686
+ // │ └──`per_peer_state`
687
+ // │ │
688
+ // │ │──`outbound_scid_aliases`
689
+ // │ │
690
+ // │ └──`pending_inbound_payments`
691
+ // │ │
692
+ // │ └──`pending_outbound_payments`
693
+ // │ │
694
+ // │ │──`best_block`
695
+ // │ │
696
+ // │ └──`pending_events`
697
+ // │ │
698
+ // │ └──`pending_background_events`
699
+ //
694
700
pub struct ChannelManager < Signer : Sign , M : Deref , T : Deref , K : Deref , F : Deref , L : Deref >
695
701
where M :: Target : chain:: Watch < Signer > ,
696
702
T :: Target : BroadcasterInterface ,
@@ -758,6 +764,8 @@ pub struct ChannelManager<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref,
758
764
/// and some closed channels which reached a usable state prior to being closed. This is used
759
765
/// only to avoid duplicates, and is not persisted explicitly to disk, but rebuilt from the
760
766
/// active channel list on load.
767
+ ///
768
+ /// See `ChannelManager` struct-level documentation for lock order requirements.
761
769
outbound_scid_aliases : Mutex < HashSet < u64 > > ,
762
770
763
771
/// `channel_id` -> `counterparty_node_id`.
0 commit comments