Skip to content

Commit f05419f

Browse files
authored
les: fix eth_sendTransaction API (#23215)
1 parent a5e3aa6 commit f05419f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

les/api_backend.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,11 @@ func (b *LesApiBackend) SetHead(number uint64) {
6060
}
6161

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

0 commit comments

Comments
 (0)