Skip to content

miner/miner_pow.go — Version Comparison

v1.16.8 v1.17.3
Branch etc/v1.16.8-full-node etc/v1.17.3-full-node
Delta +114 -0 +116 -0

Diff between branches

diff --git a/miner/miner_pow.go b/miner/miner_pow.go
index 80d7ce9a9..c55f42d07 100644
--- a/miner/miner_pow.go
+++ b/miner/miner_pow.go
@@ -75,13 +75,15 @@ func (m *Miner) Mining() bool {
    return false
 }

-// Hashrate returns the current mining hashrate.
+// Hashrate returns the current mining hashrate. The internal interface
+// matches ethash.Hashrate (float64); the value is truncated to uint64 for
+// the JSON-RPC boundary in eth/api_pow.go.
 func (m *Miner) Hashrate() uint64 {
    type hashRater interface {
-       Hashrate() uint64
+       Hashrate() float64
    }
    if hr, ok := m.engine.(hashRater); ok {
-       return hr.Hashrate()
+       return uint64(hr.Hashrate())
    }
    return 0
 }
← Back to Version Comparison