Files
m2pool_docs/m2pool_backend_app/public/distribution-hashrate.py
2026-01-30 17:47:21 +08:00

11 lines
303 B
Python

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