mirror of
https://git.wownero.com/wownero/tippero.git
synced 2024-08-15 00:33:14 +00:00
rainactive: fix issue with link objects not usable as keys in a dict
This commit is contained in:
parent
b181b19c16
commit
8a81397a84
1 changed files with 4 additions and 4 deletions
|
@ -248,7 +248,7 @@ def RainActive(link,cmd):
|
|||
l=Link(link.network,User(link.network,NickFromIdentity(i)),group)
|
||||
if l in userlist:
|
||||
userlist.remove(l)
|
||||
weights=dict()
|
||||
weights=[]
|
||||
weight=0
|
||||
log_log('userlist to loop: %s' % str([user.identity() for user in userlist]))
|
||||
for n in userlist:
|
||||
|
@ -259,7 +259,7 @@ def RainActive(link,cmd):
|
|||
dt = now - t
|
||||
if dt <= seconds:
|
||||
w = (1 * (seconds - dt) + minfrac * dt) / (seconds)
|
||||
weights[n] = w
|
||||
weights.append((n, w))
|
||||
weight += w
|
||||
|
||||
if len(weights) == 0:
|
||||
|
@ -276,8 +276,8 @@ def RainActive(link,cmd):
|
|||
nnicks = 0
|
||||
minu=None
|
||||
maxu=None
|
||||
for n in weights:
|
||||
user_units = long(units * weights[n] / weight)
|
||||
for n,w in weights:
|
||||
user_units = long(units * w / weight)
|
||||
if user_units <= 0:
|
||||
continue
|
||||
act = now - link.network.get_last_active_time(n.user.nick,link.group.name)
|
||||
|
|
Loading…
Reference in a new issue