11 lines
303 B
Python
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 |