mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00
fix the confusing term in the getHashrate() (#2081)
Co-authored-by: Michael Sutton <mikisiton2@gmail.com>
This commit is contained in:
parent
d957a6d93a
commit
5e9c28b77b
@ -136,11 +136,11 @@ func CalcWork(bits uint32) *big.Int {
|
||||
|
||||
func getHashrate(target *big.Int, TargetTimePerBlock time.Duration) *big.Int {
|
||||
// From: https://bitcoin.stackexchange.com/a/5557/40800
|
||||
// difficulty = hashrate / (2^256 / max_target / block_rate_in_seconds)
|
||||
// hashrate = difficulty * (2^256 / max_target / block_rate_in_seconds)
|
||||
// difficulty = hashrate / (2^256 / max_target / seconds_per_block)
|
||||
// hashrate = difficulty * (2^256 / max_target / seconds_per_block)
|
||||
// difficulty = max_target / target
|
||||
// hashrate = (max_target / target) * (2^256 / max_target / block_rate_in_seconds)
|
||||
// hashrate = 2^256 / (target * block_rate_in_seconds)
|
||||
// hashrate = (max_target / target) * (2^256 / max_target / seconds_per_block)
|
||||
// hashrate = 2^256 / (target * seconds_per_block)
|
||||
|
||||
tmp := new(big.Int)
|
||||
divisor := new(big.Int).Set(target)
|
||||
|
Loading…
x
Reference in New Issue
Block a user