Skip to content

Commit 3b22d14

Browse files
committed
Store merkle roots for 10 minutes
1 parent a2a9689 commit 3b22d14

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

bitHopper/Tracking/getwork_store.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#Copyright (C) 2011,2012 Colin Rice
22
#This software is licensed under an included MIT license.
33
#See the file entitled LICENSE
4-
#If you were not provided with a copy of the license please contact:
4+
#If you were not provided with a copy of the license please contact:
55
# Colin Rice colin@daedrum.net
66

77
import gevent, time, logging
@@ -10,7 +10,7 @@ class Getwork_Store:
1010
"""
1111
Class that stores getworks so we can figure out the server again
1212
"""
13-
13+
1414
def __init__(self):
1515
self.data = {}
1616
gevent.spawn(self.prune)
@@ -27,21 +27,21 @@ def get(self, merkle_root):
2727
return self.data[merkle_root][0]
2828
logging.debug('Merkle Root Not Found %s', merkle_root)
2929
return None
30-
30+
3131
def drop_roots(self):
3232
"""
3333
Resets the merkle_root database
3434
Very crude.
3535
Should probably have an invalidate block function instead
3636
"""
37-
self.data = {}
38-
37+
self.data = {}
38+
3939
def prune(self):
4040
"""
4141
Running greenlet that prunes old merkle_roots
4242
"""
4343
while True:
4444
for key, work in self.data.items():
45-
if work[1] < (time.time() - (60*3)):
45+
if work[1] < (time.time() - (60*20)):
4646
del self.data[key]
4747
gevent.sleep(60)

0 commit comments

Comments
 (0)