js代码改写py
This commit is contained in:
11
m2pool_backend_app/public/distribution-hashrate.py
Normal file
11
m2pool_backend_app/public/distribution-hashrate.py
Normal file
@@ -0,0 +1,11 @@
|
||||
def compute_weights(lst):
|
||||
total_hashrate = sum(user["mhs24h"] for user in lst)
|
||||
users_weight = [
|
||||
{
|
||||
"user": user["user"],
|
||||
"mhs24h": user["mhs24h"],
|
||||
"weight": user["mhs24h"] / total_hashrate
|
||||
}
|
||||
for user in lst
|
||||
]
|
||||
return users_weight
|
||||
Reference in New Issue
Block a user