未验证 提交 c6195623 编写于 作者: P Péter Szilágyi 提交者: GitHub

Merge pull request #23159 from karalabe/ethstats-fix-fullnode

ethstats: fix full node interface post 1559
......@@ -77,7 +77,7 @@ type fullNodeBackend interface {
Miner() *miner.Miner
BlockByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Block, error)
CurrentBlock() *types.Block
SuggestPrice(ctx context.Context) (*big.Int, error)
SuggestGasTipCap(ctx context.Context) (*big.Int, error)
}
// Service implements an Ethereum netstats reporting daemon that pushes local
......@@ -780,8 +780,11 @@ func (s *Service) reportStats(conn *connWrapper) error {
sync := fullBackend.Downloader().Progress()
syncing = fullBackend.CurrentHeader().Number.Uint64() >= sync.HighestBlock
price, _ := fullBackend.SuggestPrice(context.Background())
price, _ := fullBackend.SuggestGasTipCap(context.Background())
gasprice = int(price.Uint64())
if basefee := fullBackend.CurrentHeader().BaseFee; basefee != nil {
gasprice += int(basefee.Uint64())
}
} else {
sync := s.backend.Downloader().Progress()
syncing = s.backend.CurrentHeader().Number.Uint64() >= sync.HighestBlock
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册