Replace tokio::spawn with handle.spawn

This commit is contained in:
pawan
2020-05-19 13:48:11 +05:30
parent ea56dcb179
commit 2f4acb9112
9 changed files with 51 additions and 51 deletions

View File

@@ -84,6 +84,7 @@ pub struct Service<TSpec: EthSpec> {
impl<TSpec: EthSpec> Service<TSpec> {
pub fn new(
handle: &tokio::runtime::Handle,
config: &NetworkConfig,
enr_fork_id: EnrForkId,
log: &slog::Logger,
@@ -130,7 +131,7 @@ impl<TSpec: EthSpec> Service<TSpec> {
}
SwarmBuilder::new(transport, behaviour, local_peer_id.clone())
.peer_connection_limit(MAX_CONNECTIONS_PER_PEER)
.executor(Box::new(Executor(tokio::runtime::Handle::current())))
.executor(Box::new(Executor(handle.clone())))
.build()
};