mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-28 07:36:44 +00:00
fix(api): change gas_price to use pending block (#1082)
* fix(api): change gas_price to use pending block
This commit is contained in:
parent
c88cc480b0
commit
9fff27e4f3
3 changed files with 5 additions and 3 deletions
|
|
@ -68,8 +68,9 @@ func (s *PublicEthereumAPI) 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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ type Backend interface {
|
|||
BlockByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Block, error)
|
||||
BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)
|
||||
BlockByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Block, error)
|
||||
PendingBlockAndReceipts() (*types.Block, types.Receipts)
|
||||
StateAndHeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*state.StateDB, *types.Header, error)
|
||||
StateAndHeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*state.StateDB, *types.Header, error)
|
||||
StateAt(root common.Hash) (*state.StateDB, error)
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import (
|
|||
const (
|
||||
VersionMajor = 5 // Major version component of the current release
|
||||
VersionMinor = 7 // Minor version component of the current release
|
||||
VersionPatch = 24 // Patch version component of the current release
|
||||
VersionPatch = 25 // Patch version component of the current release
|
||||
VersionMeta = "mainnet" // Version metadata to append to the version string
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue