Skip to content

Commit

Permalink
Fix panic
Browse files Browse the repository at this point in the history
  • Loading branch information
wtdcode committed Feb 29, 2024
1 parent 228ee70 commit 03a0463
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/revm/src/db/ethersdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ impl<M: Middleware> EthersDB<M> {
/// internal utility function to call tokio feature and wait for output
fn block_on<F: core::future::Future>(&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()
Expand Down

0 comments on commit 03a0463

Please sign in to comment.