We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a01106 commit 0cc4fa9Copy full SHA for 0cc4fa9
src/raft.rs
@@ -3215,6 +3215,16 @@ impl<T: Storage> Raft<T> {
3215
}
3216
3217
3218
+ /// Whether two peers are in the same broadcast group.
3219
+ pub fn is_in_same_broadcast_group(&self, id: u64, id_other: u64) -> bool {
3220
+ let group_id = self.prs().get(id).map_or(0, |pr| pr.broadcast_group_id);
3221
+ let other_group_id = self
3222
+ .prs()
3223
+ .get(id_other)
3224
+ .map_or(0, |pr| pr.broadcast_group_id);
3225
+ group_id != 0 && other_group_id != 0 && group_id == other_group_id
3226
+ }
3227
+
3228
// Whether this peer is active recently.
3229
#[inline]
3230
fn is_recent_active(&self, id: u64) -> bool {
0 commit comments