mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
fix: skip block tracing if empty (#7251)
This commit is contained in:
@ -79,6 +79,11 @@ where
|
||||
block_env: BlockEnv,
|
||||
opts: GethDebugTracingOptions,
|
||||
) -> EthResult<Vec<TraceResult>> {
|
||||
if transactions.is_empty() {
|
||||
// nothing to trace
|
||||
return Ok(Vec::new());
|
||||
}
|
||||
|
||||
// replay all transactions of the block
|
||||
let this = self.clone();
|
||||
self.inner
|
||||
|
||||
@ -1058,6 +1058,11 @@ where
|
||||
|
||||
let Some(block) = block else { return Ok(None) };
|
||||
|
||||
if block.body.is_empty() {
|
||||
// nothing to trace
|
||||
return Ok(Some(Vec::new()));
|
||||
}
|
||||
|
||||
// replay all transactions of the block
|
||||
self.spawn_tracing_task_with(move |this| {
|
||||
// we need to get the state of the parent block because we're replaying this block on
|
||||
|
||||
Reference in New Issue
Block a user