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)
|
SuggestGasTipCap(ctx context.Context) (*big.Int, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mining
|
// miningNodeBackend encompasses the functionality necessary for a mining node
|
||||||
|
// reporting to ethstats
|
||||||
type miningNodeBackend interface {
|
type miningNodeBackend interface {
|
||||||
fullNodeBackend
|
fullNodeBackend
|
||||||
Miner() *miner.Miner
|
Miner() *miner.Miner
|
||||||
|
|
@ -785,10 +786,8 @@ func (s *Service) reportStats(conn *connWrapper) error {
|
||||||
gasprice int
|
gasprice int
|
||||||
)
|
)
|
||||||
// check if backend is a full node
|
// check if backend is a full node
|
||||||
fullBackend, ok := s.backend.(fullNodeBackend)
|
if fullBackend, ok := s.backend.(fullNodeBackend); ok {
|
||||||
if ok {
|
if miningBackend, ok := s.backend.(miningNodeBackend); ok {
|
||||||
miningBackend, miningOk := s.backend.(miningNodeBackend)
|
|
||||||
if miningOk {
|
|
||||||
mining = miningBackend.Miner().Mining()
|
mining = miningBackend.Miner().Mining()
|
||||||
hashrate = int(miningBackend.Miner().Hashrate())
|
hashrate = int(miningBackend.Miner().Hashrate())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue