Spawn connect_and_req calls (#296)

Avoids delays in connecting with long timeouts stalling the node.
This commit is contained in:
AntiochP 2017-11-17 15:17:14 -05:00 committed by Ignotus Peverell
parent bb7a61d284
commit 2a92eab675

View file

@ -197,16 +197,17 @@ impl Seeder {
debug!(LOGGER, "New peer address to connect to: {}.", peer_addr); debug!(LOGGER, "New peer address to connect to: {}.", peer_addr);
let inner_h = h.clone(); let inner_h = h.clone();
if p2p_server.peer_count() < PEER_MAX_COUNT { if p2p_server.peer_count() < PEER_MAX_COUNT {
connect_and_req( h.spawn(
capab, connect_and_req(
p2p_store.clone(), capab,
p2p_server.clone(), p2p_store.clone(),
inner_h, p2p_server.clone(),
peer_addr, inner_h,
peer_addr,
)
) )
} else { };
Box::new(future::ok(())) Box::new(future::ok(()))
}
}); });
Box::new(listener) Box::new(listener)
} }