git://git.novaco.in
/
p2pool.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
25ddab1
)
added shares argument to Tracker.__init__
author
Forrest Voight
<forrest@forre.st>
Sat, 10 Dec 2011 03:57:32 +0000 (22:57 -0500)
committer
Forrest Voight
<forrest@forre.st>
Sat, 10 Dec 2011 03:57:32 +0000 (22:57 -0500)
p2pool/util/forest.py
patch
|
blob
|
history
diff --git
a/p2pool/util/forest.py
b/p2pool/util/forest.py
index
8234f02
..
1cb0636
100644
(file)
--- a/
p2pool/util/forest.py
+++ b/
p2pool/util/forest.py
@@
-43,7
+43,7
@@
class DistanceSkipList(skiplist.SkipList):
# linked list tracker
class Tracker(object):
- def __init__(self):
+ def __init__(self, shares=[]):
self.shares = {} # hash -> share
#self.ids = {} # hash -> (id, height)
self.reverse_shares = {} # previous_hash -> set of share_hashes
@@
-62,6
+62,9
@@
class Tracker(object):
self.added = variable.Event()
self.removed = variable.Event()
+
+ for share in shares:
+ self.add(share)
def add(self, share):
assert not isinstance(share, (int, long, type(None)))