Skip to content

Commit

Permalink
ethstats: fix full node interface post 1559
Browse files Browse the repository at this point in the history
  • Loading branch information
karalabe committed Jul 5, 2021
1 parent 3b05318 commit 6b6d319
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ethstats/ethstats.go
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6b6d319

Please sign in to comment.