Skip to content

Commit 334a8a1

Browse files
committed
fixes: check if balance is empty for coinbase
1 parent c8262c9 commit 334a8a1

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

crates/evm/src/eth/block.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -312,12 +312,17 @@ where
312312
tracing::debug!("Before coinbase:{:?}", bal);
313313

314314
if bal.len() == 5 {
315-
bal = bal
316-
.into_iter()
317-
.filter(|a| {
318-
a.address != self.evm.block().beneficiary() && !a.balance_changes.is_empty()
319-
})
320-
.collect();
315+
let beneficiary = self.evm.block().beneficiary();
316+
bal =
317+
bal.into_iter()
318+
.filter(|a| {
319+
if a.address == beneficiary {
320+
!a.balance_changes.is_empty()
321+
} else {
322+
true
323+
}
324+
})
325+
.collect();
321326
tracing::debug!("After coinbase:{:?}", bal);
322327
}
323328
Ok((

0 commit comments

Comments
 (0)