When restarting client, also "restart" tokio runtime (#1065)

* remember new tokio runtime on reconnect

* compilation
This commit is contained in:
Svyatoslav Nikolsky
2021-07-21 13:59:16 +03:00
committed by Bastian Köcher
parent 63d6fc436a
commit 09d30894d1
2 changed files with 6 additions and 2 deletions
@@ -125,7 +125,9 @@ impl<C: Chain> Client<C> {
/// Reopen client connection.
pub async fn reconnect(&mut self) -> Result<()> {
self.client = Self::build_client(self.params.clone()).await?.1;
let (tokio, client) = Self::build_client(self.params.clone()).await?;
self.tokio = tokio;
self.client = client;
Ok(())
}