mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
Merge pull request #5414
e9fac29a
unit_tests/long_term_block_weight: some tweaks that seem to make more sense (stoffu)467f4c7e
tests/block_weight: use integer division when computing median (stoffu)815d08dc
tests/block_weight: remove unused MULTIPLIER_SMALL (stoffu)661f1fb8
blockchain: remove unused calc of short_term_constraint (stoffu)
This commit is contained in:
commit
0d2aaac15b
3 changed files with 11 additions and 12 deletions
|
@ -9,7 +9,6 @@ import math
|
|||
|
||||
MEDIAN_WINDOW_SMALL = 100 # number of recent blocks for median computation
|
||||
MEDIAN_WINDOW_BIG = 5000
|
||||
MULTIPLIER_SMALL = 1.4 # multipliers for determining weights
|
||||
MULTIPLIER_BIG = 50.0
|
||||
MEDIAN_THRESHOLD = 300*1000 # initial value for median (scaled kB -> B)
|
||||
lcg_seed = 0
|
||||
|
@ -24,9 +23,9 @@ def get_median(vec):
|
|||
#temp = vec
|
||||
temp = sorted(vec)
|
||||
if len(temp) % 2 == 1:
|
||||
return temp[len(temp)/2]
|
||||
return temp[len(temp)//2]
|
||||
else:
|
||||
return int((temp[len(temp)/2]+temp[len(temp)/2-1])/2)
|
||||
return int((temp[len(temp)//2]+temp[len(temp)//2-1])//2)
|
||||
|
||||
def LCG():
|
||||
global lcg_seed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue