From 03a04637104b08536f575e7e14ccd4ec1e9c64a3 Mon Sep 17 00:00:00 2001 From: mio Date: Thu, 29 Feb 2024 19:33:28 +0800 Subject: [PATCH] Fix panic --- crates/revm/src/db/ethersdb.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/revm/src/db/ethersdb.rs b/crates/revm/src/db/ethersdb.rs index f072b3e405..7573b85554 100644 --- a/crates/revm/src/db/ethersdb.rs +++ b/crates/revm/src/db/ethersdb.rs @@ -34,7 +34,11 @@ impl EthersDB { /// internal utility function to call tokio feature and wait for output fn block_on(&self, f: F) -> F::Output { match Handle::try_current() { - Ok(handle) => handle.block_on(f), + Ok(handle) => { + tokio::task::block_in_place(move || { + handle.block_on(f) + }) + } Err(_) => Builder::new_current_thread() .enable_all() .build()