mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
ethstats: Address comments
This commit is contained in:
parent
ca995303d9
commit
39a00a138f
1 changed files with 4 additions and 5 deletions
|
|
@ -81,7 +81,8 @@ type fullNodeBackend interface {
|
|||
SuggestGasTipCap(ctx context.Context) (*big.Int, error)
|
||||
}
|
||||
|
||||
// Mining
|
||||
// miningNodeBackend encompasses the functionality necessary for a mining node
|
||||
// reporting to ethstats
|
||||
type miningNodeBackend interface {
|
||||
fullNodeBackend
|
||||
Miner() *miner.Miner
|
||||
|
|
@ -785,10 +786,8 @@ func (s *Service) reportStats(conn *connWrapper) error {
|
|||
gasprice int
|
||||
)
|
||||
// check if backend is a full node
|
||||
fullBackend, ok := s.backend.(fullNodeBackend)
|
||||
if ok {
|
||||
miningBackend, miningOk := s.backend.(miningNodeBackend)
|
||||
if miningOk {
|
||||
if fullBackend, ok := s.backend.(fullNodeBackend); ok {
|
||||
if miningBackend, ok := s.backend.(miningNodeBackend); ok {
|
||||
mining = miningBackend.Miner().Mining()
|
||||
hashrate = int(miningBackend.Miner().Hashrate())
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue