func (self *GasPriceOracle) processPastBlocks(chain *core.BlockChain) { last := int64(-1) cblock := chain.CurrentBlock() if cblock != nil { last = int64(cblock.NumberU64()) } first := int64(0) if last > gpoProcessPastBlocks { first = last - gpoProcessPastBlocks } self.firstProcessed = uint64(first) for i := first; i <= last; i++ { block := chain.GetBlockByNumber(uint64(i)) if block != nil { self.processBlock(block) } } }