eth: fixup

This commit is contained in:
Felix Lange 2025-04-03 15:36:58 +02:00
parent 0ce8fe3fd4
commit fbc32aa9b1

View file

@ -155,8 +155,7 @@ func (b *EthAPIBackend) BlockByNumber(ctx context.Context, number rpc.BlockNumbe
bn = b.HistoryPruningCutoff()
}
block := b.eth.blockchain.GetBlockByNumber(bn)
historyCutoff, _ := b.eth.blockchain.HistoryPruningCutoff()
if block == nil && bn < historyCutoff {
if block == nil && bn < b.HistoryPruningCutoff() {
return nil, &ethconfig.PrunedHistoryError{}
}
return block, nil