File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -1837,6 +1837,7 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
18371837
18381838 // First add all connected peers, preferring to list the connected address if available.
18391839 let connected_peers = self . peer_manager . get_peer_node_ids ( ) ;
1840+ let connected_peers_len = connected_peers. len ( ) ;
18401841 for ( node_id, con_addr_opt) in connected_peers {
18411842 let stored_peer = self . peer_store . get_peer ( & node_id) ;
18421843 let stored_addr_opt = stored_peer. as_ref ( ) . map ( |p| p. address . clone ( ) ) ;
@@ -1854,7 +1855,7 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
18541855
18551856 // Now add all known-but-offline peers, too.
18561857 for p in self . peer_store . list_peers ( ) {
1857- if peers. iter ( ) . find ( |d| d. node_id == p. node_id ) . is_some ( ) {
1858+ if peers. iter ( ) . take ( connected_peers_len ) . find ( |d| d. node_id == p. node_id ) . is_some ( ) {
18581859 continue ;
18591860 }
18601861
You can’t perform that action at this time.
0 commit comments