Spawn connect_and_req calls
Avoids delays in connecting with long timeouts stalling the node.
@@ -197,6 +197,7 @@ impl Seeder {
debug!(LOGGER, "New peer address to connect to: {}.", peer_addr);
let inner_h = h.clone();
if p2p_server.peer_count() < PEER_MAX_COUNT {
+ h.spawn(
connect_and_req(
capab,
p2p_store.clone(),
@@ -204,9 +205,9 @@ impl Seeder {
inner_h,
peer_addr,
)
- } else {
+ )
+ };
Box::new(future::ok(()))
- }
});
Box::new(listener)
}
