Skip to content

Commit 6c0fdf8

Browse files
f - Store channels per-peer: Update per_peer_state docs
1 parent 9c1d6ce commit 6c0fdf8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -786,8 +786,13 @@ pub struct ChannelManager<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref,
786786
///
787787
/// If we are connected to a peer we always at least have an entry here, even if no channels
788788
/// are currently open with that peer.
789-
/// Currently, we usually take an outer read lock and then operate on the inner value freely.
790-
/// Sadly, this prevents parallel per-peer operation.
789+
///
790+
/// Because adding or removing an entry is rare, we usually take an outer read lock and then
791+
/// operate on the inner value freely. This opens up for parallel per-peer operation for
792+
/// channels. Sadly, most functions that operate on the channels currently also require that
793+
/// the `channel_state` lock is aquired until more fields from the `channel_state` is moved.
794+
/// Aquiring the `channel_state` lock blocks parallel per-peer operation in the cases where it
795+
/// is needed.
791796
///
792797
/// If also holding `channel_state` lock, must lock `channel_state` prior to `per_peer_state`.
793798
#[cfg(not(any(test, feature = "_test_utils")))]

0 commit comments

Comments
 (0)