File tree Expand file tree Collapse file tree 2 files changed +7
-11
lines changed
Expand file tree Collapse file tree 2 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -129,15 +129,11 @@ impl PeersState {
129129
130130 if desync {
131131 CacheState :: Desynced {
132- is_leader : self
133- . list
134- . values ( )
135- . find ( |data| {
136- data. cache_hash == hash
137- && data. peer_id . as_str ( ) < peer_id
138- && data. publication_timestamp > cur_ts
139- } )
140- . is_none ( ) ,
132+ is_leader : !self . list . values ( ) . any ( |data| {
133+ data. cache_hash == hash
134+ && data. peer_id . as_str ( ) < peer_id
135+ && data. publication_timestamp > cur_ts
136+ } ) ,
141137 }
142138 } else {
143139 CacheState :: Synced
Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ pub fn dht_channel(
151151 JoinHandle < Swarm < DomoBehaviour > > ,
152152) {
153153 let ( cmd_send, mut cmd_recv) = mpsc:: unbounded_channel ( ) ;
154- let ( mut ev_send, ev_recv) = mpsc:: unbounded_channel ( ) ;
154+ let ( ev_send, ev_recv) = mpsc:: unbounded_channel ( ) ;
155155
156156 let handle = tokio:: task:: spawn ( async move {
157157 loop {
@@ -164,7 +164,7 @@ pub fn dht_channel(
164164 }
165165 }
166166 ev = swarm. select_next_some( ) => {
167- if handle_swarm_event( & mut swarm, ev, & mut ev_send) . is_err( ) {
167+ if handle_swarm_event( & mut swarm, ev, & ev_send) . is_err( ) {
168168 log:: debug!( "Exiting ev" ) ;
169169 return swarm
170170 }
You can’t perform that action at this time.
0 commit comments