Skip to content

Commit

Permalink
les: fix eth_sendTransaction API (ethereum#23215)
Browse files Browse the repository at this point in the history
  • Loading branch information
rjl493456442 committed Jul 15, 2021
1 parent a5e3aa6 commit f05419f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion les/api_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ func (b *LesApiBackend) SetHead(number uint64) {
}

func (b *LesApiBackend) HeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Header, error) {
// Return the latest current as the pending one since there
// is no pending notion in the light client. TODO(rjl493456442)
// unify the behavior of `HeaderByNumber` and `PendingBlockAndReceipts`.
if number == rpc.PendingBlockNumber {
return nil, nil
return b.eth.blockchain.CurrentHeader(), nil
}
if number == rpc.LatestBlockNumber {
return b.eth.blockchain.CurrentHeader(), nil
Expand Down

0 comments on commit f05419f

Please sign in to comment.