@@ -94,7 +94,7 @@ func (b *EthAPIBackend) HeaderByNumber(ctx context.Context, number rpc.BlockNumb
94
94
}
95
95
var bn uint64
96
96
if number == rpc .EarliestBlockNumber {
97
- bn = b .eth . blockchain . HistoryPruningCutoff ()
97
+ bn = b .HistoryPruningCutoff ()
98
98
} else {
99
99
bn = uint64 (number )
100
100
}
@@ -152,10 +152,10 @@ func (b *EthAPIBackend) BlockByNumber(ctx context.Context, number rpc.BlockNumbe
152
152
}
153
153
bn := uint64 (number ) // the resolved number
154
154
if number == rpc .EarliestBlockNumber {
155
- bn = b .eth . blockchain . HistoryPruningCutoff ()
155
+ bn = b .HistoryPruningCutoff ()
156
156
}
157
157
block := b .eth .blockchain .GetBlockByNumber (bn )
158
- if block == nil && bn < b .eth . blockchain . HistoryPruningCutoff () {
158
+ if block == nil && bn < b .HistoryPruningCutoff () {
159
159
return nil , & ethconfig.PrunedHistoryError {}
160
160
}
161
161
return block , nil
@@ -167,7 +167,7 @@ func (b *EthAPIBackend) BlockByHash(ctx context.Context, hash common.Hash) (*typ
167
167
return nil , nil
168
168
}
169
169
block := b .eth .blockchain .GetBlock (hash , * number )
170
- if block == nil && * number < b .eth . blockchain . HistoryPruningCutoff () {
170
+ if block == nil && * number < b .HistoryPruningCutoff () {
171
171
return nil , & ethconfig.PrunedHistoryError {}
172
172
}
173
173
return block , nil
@@ -180,7 +180,7 @@ func (b *EthAPIBackend) GetBody(ctx context.Context, hash common.Hash, number rp
180
180
}
181
181
body := b .eth .blockchain .GetBody (hash )
182
182
if body == nil {
183
- if uint64 (number ) < b .eth . blockchain . HistoryPruningCutoff () {
183
+ if uint64 (number ) < b .HistoryPruningCutoff () {
184
184
return nil , & ethconfig.PrunedHistoryError {}
185
185
}
186
186
return nil , errors .New ("block body not found" )
@@ -202,7 +202,7 @@ func (b *EthAPIBackend) BlockByNumberOrHash(ctx context.Context, blockNrOrHash r
202
202
}
203
203
block := b .eth .blockchain .GetBlock (hash , header .Number .Uint64 ())
204
204
if block == nil {
205
- if header .Number .Uint64 () < b .eth . blockchain . HistoryPruningCutoff () {
205
+ if header .Number .Uint64 () < b .HistoryPruningCutoff () {
206
206
return nil , & ethconfig.PrunedHistoryError {}
207
207
}
208
208
return nil , errors .New ("header found, but block body is missing" )
@@ -265,7 +265,8 @@ func (b *EthAPIBackend) StateAndHeaderByNumberOrHash(ctx context.Context, blockN
265
265
}
266
266
267
267
func (b * EthAPIBackend ) HistoryPruningCutoff () uint64 {
268
- return b .eth .blockchain .HistoryPruningCutoff ()
268
+ bn , _ := b .eth .blockchain .HistoryPruningCutoff ()
269
+ return bn
269
270
}
270
271
271
272
func (b * EthAPIBackend ) GetReceipts (ctx context.Context , hash common.Hash ) (types.Receipts , error ) {
0 commit comments