Skip to content

Commit f914e01

Browse files
authored
fix(anvil): guard against the blockchain advancing while checking latest block (#10714)
fix: guard against the blockchain advancing while checking latest block
1 parent 1334c42 commit f914e01

File tree

1 file changed

+1
-1
lines changed
  • crates/anvil/src/eth/backend/mem

1 file changed

+1
-1
lines changed

crates/anvil/src/eth/backend/mem/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2290,7 +2290,7 @@ impl Backend {
22902290
.number
22912291
}
22922292
BlockId::Number(num) => match num {
2293-
BlockNumber::Latest | BlockNumber::Pending => self.best_number(),
2293+
BlockNumber::Latest | BlockNumber::Pending => current,
22942294
BlockNumber::Earliest => U64::ZERO.to::<u64>(),
22952295
BlockNumber::Number(num) => num,
22962296
BlockNumber::Safe => current.saturating_sub(self.slots_in_an_epoch),

0 commit comments

Comments
 (0)