Skip to content

Commit

Permalink
[fix]: fix block log query range
Browse files Browse the repository at this point in the history
  • Loading branch information
Sha3nS committed Aug 15, 2023
1 parent 09a9ef8 commit 5c5b8fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gas-oracle/oracle/gas_price_oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func (g *GasPriceOracle) OverHeadLoop() {
continue
}
// repeat query latest block is not allowed
if height != nil && height.Uint64() != 0 && height.Uint64() == latestHeader.Number.Uint64() {
if height != nil && height.Uint64() != 0 && height.Uint64() >= latestHeader.Number.Uint64() {
continue
}
if height == nil || height.Uint64() == 0 {
Expand All @@ -254,7 +254,7 @@ func (g *GasPriceOracle) OverHeadLoop() {
}
}
_ = writeGasOracleSyncHeight(db, latestHeader.Number)
height = latestHeader.Number
height = latestHeader.Number.Add(latestHeader.Number, big.NewInt(1))
log.Info("Update synced height", "height", height)
case ev := <-stateBatchAppendChan:
currentCtcBatches, err := g.ctcBackend.GetTotalBatches(&bind.CallOpts{})
Expand Down

0 comments on commit 5c5b8fc

Please sign in to comment.