ethstats: fix full node interface post 1559 #23159 (#1451)

This commit is contained in:
Daniel Liu 2025-09-08 15:41:16 +08:00 committed by GitHub
parent 84e19a7b7f
commit 58184f0212
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -87,7 +87,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
@ -842,7 +842,7 @@ func (s *Service) reportStats(conn *connWrapper) error {
sync := fullBackend.Downloader().Progress()
syncing = fullBackend.CurrentHeader().Number.Uint64() >= sync.HighestBlock
price, _ := s.backend.SuggestGasTipCap(context.Background())
price, _ := fullBackend.SuggestGasTipCap(context.Background())
gasprice = int(price.Uint64())
if basefee := fullBackend.CurrentHeader().BaseFee; basefee != nil {
gasprice += int(basefee.Uint64())