diff options
author | Riccardo Spagni <ric@spagni.net> | 2019-04-16 22:37:02 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2019-04-16 22:37:02 +0200 |
commit | 0d2aaac15b37d0dfcfd59af23d127ff6f3e3b2b2 (patch) | |
tree | 757cbbc62f421f8ae2d17caa93dd21791c2782fd /tests/block_weight | |
parent | Merge pull request #5412 (diff) | |
parent | unit_tests/long_term_block_weight: some tweaks that seem to make more sense (diff) | |
download | monero-0d2aaac15b37d0dfcfd59af23d127ff6f3e3b2b2.tar.xz |
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)
Diffstat (limited to 'tests/block_weight')
-rwxr-xr-x | tests/block_weight/block_weight.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/block_weight/block_weight.py b/tests/block_weight/block_weight.py index ba533c53c..b23da3d77 100755 --- a/tests/block_weight/block_weight.py +++ b/tests/block_weight/block_weight.py @@ -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 |