snuggleGuru

Untitled

Feb 13th, 2018
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. # Tom Harold (Degnr8) WT
  2. # Modified by Zawy to be a weighted-Weighted Harmonic Mean (WWHM)
  3. # No limits in rise or fall rate should be employed.
  4. # MTP should not be used.
  5. # adjust=0.99 # 0.98 for N=30, 0.99 for N=60
  6. k = (N+1)/2 * T * adjust
  7.  
  8. # original algorithm
  9. d=0, t=0, j=0
  10. for i = height - N+1 to height # (N most recent blocks)
  11. # TS = timestamp
  12. solvetime = TS[i] - TS[i-1]
  13. solvetime = 10*T if solvetime > 10*T
  14. solvetime = -9*T if solvetime < -9*T
  15. j++
  16. t += solvetime * j
  17. d +=D[i] # sum the difficulties
  18. next i
  19. t=T*N/2 if t < T*N/2 # in case of startup weirdness, keep t reasonable
  20. next_D = d * k / t
Advertisement
Add Comment
Please, Sign In to add comment