You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.. as we want to make sure writers will be preferred here, i.e., avoid
that a user calling `list_channels` too often would result in processing
being blocked.
/// The set of events which we need to give to the user to handle. In some cases an event may
1367
1367
/// require some further action after the user handles it (currently only blocking a monitor
@@ -9175,7 +9175,7 @@ where
9175
9175
res = Err(());
9176
9176
return NotifyOption::SkipPersistNoEvents;
9177
9177
}
9178
-
e.insert(RwLock::new(PeerState {
9178
+
e.insert(FairRwLock::new(PeerState {
9179
9179
channel_by_id: new_hash_map(),
9180
9180
inbound_channel_request_by_id: new_hash_map(),
9181
9181
latest_features: init_msg.features.clone(),
@@ -10744,13 +10744,13 @@ where
10744
10744
};
10745
10745
10746
10746
let peer_count: u64 = Readable::read(reader)?;
10747
-
let mut per_peer_state = hash_map_with_capacity(cmp::min(peer_count as usize, MAX_ALLOC_SIZE/mem::size_of::<(PublicKey, RwLock<PeerState<SP>>)>()));
10747
+
let mut per_peer_state = hash_map_with_capacity(cmp::min(peer_count as usize, MAX_ALLOC_SIZE/mem::size_of::<(PublicKey, FairRwLock<PeerState<SP>>)>()));
10748
10748
for _ in 0..peer_count {
10749
10749
let peer_pubkey = Readable::read(reader)?;
10750
10750
let peer_chans = funded_peer_channels.remove(&peer_pubkey).unwrap_or(new_hash_map());
10751
10751
let mut peer_state = peer_state_from_chans(peer_chans);
0 commit comments