Skip to content

Commit

Permalink
fix(api): change gas_price to use pending block (#1082) (#1084)
Browse files Browse the repository at this point in the history
* fix(api): change gas_price to use pending block (#1082)

* fix(api): change gas_price to use pending block

* fix

---------

Co-authored-by: Morty <[email protected]>
  • Loading branch information
0xmountaintop and yiweichi authored Oct 30, 2024
1 parent 69ce8d9 commit 9f83e9d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ func (s *EthereumAPI) GasPrice(ctx context.Context) (*hexutil.Big, error) {
if err != nil {
return nil, err
}
if head := s.b.CurrentHeader(); head.BaseFee != nil {
tipcap.Add(tipcap, head.BaseFee)
pendingBlock, _ := s.b.PendingBlockAndReceipts()
if pendingBlock != nil && pendingBlock.BaseFee() != nil {
tipcap.Add(tipcap, pendingBlock.BaseFee())
}
return (*hexutil.Big)(tipcap), err
}
Expand Down

0 comments on commit 9f83e9d

Please sign in to comment.