From e1f1d3085c6b868de93313700cac8a325e9b148b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 12 Jul 2018 17:36:07 +0300 Subject: accounts, eth, les: blockhash based filtering on all code paths --- les/api_backend.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'les') diff --git a/les/api_backend.go b/les/api_backend.go index dea33c470..4232d3ae0 100644 --- a/les/api_backend.go +++ b/les/api_backend.go @@ -60,10 +60,13 @@ func (b *LesApiBackend) HeaderByNumber(ctx context.Context, blockNr rpc.BlockNum if blockNr == rpc.LatestBlockNumber || blockNr == rpc.PendingBlockNumber { return b.eth.blockchain.CurrentHeader(), nil } - return b.eth.blockchain.GetHeaderByNumberOdr(ctx, uint64(blockNr)) } +func (b *LesApiBackend) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error) { + return b.eth.blockchain.GetHeaderByHash(hash), nil +} + func (b *LesApiBackend) BlockByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Block, error) { header, err := b.HeaderByNumber(ctx, blockNr) if header == nil || err != nil { -- cgit v1.2.3