File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -47,14 +47,21 @@ func NewGasPriceOracle(eth *Ethereum) (self *GasPriceOracle) {
47
47
}
48
48
49
49
func (self * GasPriceOracle ) processPastBlocks () {
50
- last := self .chain .CurrentBlock ().NumberU64 ()
51
- first := uint64 (0 )
50
+ last := int64 (- 1 )
51
+ cblock := self .chain .CurrentBlock ()
52
+ if cblock != nil {
53
+ last = int64 (cblock .NumberU64 ())
54
+ }
55
+ first := int64 (0 )
52
56
if last > gpoProcessPastBlocks {
53
57
first = last - gpoProcessPastBlocks
54
58
}
55
- self .firstProcessed = first
59
+ self .firstProcessed = uint64 ( first )
56
60
for i := first ; i <= last ; i ++ {
57
- self .processBlock (self .chain .GetBlockByNumber (i ))
61
+ block := self .chain .GetBlockByNumber (uint64 (i ))
62
+ if block != nil {
63
+ self .processBlock (block )
64
+ }
58
65
}
59
66
60
67
}
You can’t perform that action at this time.
0 commit comments