Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Tom Harold (Degnr8) WT
- # Modified by Zawy to be a weighted-Weighted Harmonic Mean (WWHM)
- # No limits in rise or fall rate should be employed.
- # MTP should not be used.
- # adjust=0.99 # 0.98 for N=30, 0.99 for N=60
- k = (N+1)/2 * T * adjust
- # original algorithm
- d=0, t=0, j=0
- for i = height - N+1 to height # (N most recent blocks)
- # TS = timestamp
- solvetime = TS[i] - TS[i-1]
- solvetime = 10*T if solvetime > 10*T
- solvetime = -9*T if solvetime < -9*T
- j++
- t += solvetime * j
- d +=D[i] # sum the difficulties
- next i
- t=T*N/2 if t < T*N/2 # in case of startup weirdness, keep t reasonable
- next_D = d * k / t
Advertisement
Add Comment
Please, Sign In to add comment