@@ -94,7 +94,7 @@ func (b *EthAPIBackend) HeaderByNumber(ctx context.Context, number rpc.BlockNumb
9494 }
9595 var bn uint64
9696 if number == rpc .EarliestBlockNumber {
97- bn = b .eth . blockchain . HistoryPruningCutoff ()
97+ bn = b .HistoryPruningCutoff ()
9898 } else {
9999 bn = uint64 (number )
100100 }
@@ -152,10 +152,10 @@ func (b *EthAPIBackend) BlockByNumber(ctx context.Context, number rpc.BlockNumbe
152152 }
153153 bn := uint64 (number ) // the resolved number
154154 if number == rpc .EarliestBlockNumber {
155- bn = b .eth . blockchain . HistoryPruningCutoff ()
155+ bn = b .HistoryPruningCutoff ()
156156 }
157157 block := b .eth .blockchain .GetBlockByNumber (bn )
158- if block == nil && bn < b .eth . blockchain . HistoryPruningCutoff () {
158+ if block == nil && bn < b .HistoryPruningCutoff () {
159159 return nil , & ethconfig.PrunedHistoryError {}
160160 }
161161 return block , nil
@@ -167,7 +167,7 @@ func (b *EthAPIBackend) BlockByHash(ctx context.Context, hash common.Hash) (*typ
167167 return nil , nil
168168 }
169169 block := b .eth .blockchain .GetBlock (hash , * number )
170- if block == nil && * number < b .eth . blockchain . HistoryPruningCutoff () {
170+ if block == nil && * number < b .HistoryPruningCutoff () {
171171 return nil , & ethconfig.PrunedHistoryError {}
172172 }
173173 return block , nil
@@ -180,7 +180,7 @@ func (b *EthAPIBackend) GetBody(ctx context.Context, hash common.Hash, number rp
180180 }
181181 body := b .eth .blockchain .GetBody (hash )
182182 if body == nil {
183- if uint64 (number ) < b .eth . blockchain . HistoryPruningCutoff () {
183+ if uint64 (number ) < b .HistoryPruningCutoff () {
184184 return nil , & ethconfig.PrunedHistoryError {}
185185 }
186186 return nil , errors .New ("block body not found" )
@@ -202,7 +202,7 @@ func (b *EthAPIBackend) BlockByNumberOrHash(ctx context.Context, blockNrOrHash r
202202 }
203203 block := b .eth .blockchain .GetBlock (hash , header .Number .Uint64 ())
204204 if block == nil {
205- if header .Number .Uint64 () < b .eth . blockchain . HistoryPruningCutoff () {
205+ if header .Number .Uint64 () < b .HistoryPruningCutoff () {
206206 return nil , & ethconfig.PrunedHistoryError {}
207207 }
208208 return nil , errors .New ("header found, but block body is missing" )
@@ -265,7 +265,8 @@ func (b *EthAPIBackend) StateAndHeaderByNumberOrHash(ctx context.Context, blockN
265265}
266266
267267func (b * EthAPIBackend ) HistoryPruningCutoff () uint64 {
268- return b .eth .blockchain .HistoryPruningCutoff ()
268+ bn , _ := b .eth .blockchain .HistoryPruningCutoff ()
269+ return bn
269270}
270271
271272func (b * EthAPIBackend ) GetReceipts (ctx context.Context , hash common.Hash ) (types.Receipts , error ) {
0 commit comments