Skip to content

Commit a813a2c

Browse files
grandizzyalexghr
andauthored
fix(anvil): guard against the blockchain advancing while checking latest block (backport to v1.2.3) (#10716)
fix(anvil): guard against the blockchain advancing while checking latest block (#10714) fix: guard against the blockchain advancing while checking latest block Co-authored-by: Alex Gherghisan <[email protected]>
1 parent 7a6eb65 commit a813a2c

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
@@ -2238,7 +2238,7 @@ impl Backend {
22382238
.number
22392239
}
22402240
BlockId::Number(num) => match num {
2241-
BlockNumber::Latest | BlockNumber::Pending => self.best_number(),
2241+
BlockNumber::Latest | BlockNumber::Pending => current,
22422242
BlockNumber::Earliest => U64::ZERO.to::<u64>(),
22432243
BlockNumber::Number(num) => num,
22442244
BlockNumber::Safe => current.saturating_sub(self.slots_in_an_epoch),

0 commit comments

Comments
 (0)