From 6b6d3190cf9508e96ad28b236fda050776576989 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Mon, 5 Jul 2021 10:49:52 +0300 Subject: [PATCH] ethstats: fix full node interface post 1559 --- ethstats/ethstats.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ethstats/ethstats.go b/ethstats/ethstats.go index 42d88f6db6..148359110c 100644 --- a/ethstats/ethstats.go +++ b/ethstats/ethstats.go @@ -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