File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
77import 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 )
You can’t perform that action at this time.
0 commit comments