Permalink
Browse files

cleaning

  • Loading branch information...
1 parent c6af93f commit e62c0c133bf29352cf15c77443cd6d7ba966226c @forrestv committed Aug 2, 2011
Showing with 8 additions and 3 deletions.
  1. +1 −1 Bennu/kernels/python.py
  2. +7 −2 Bennu/main.py
View
@@ -9,7 +9,7 @@ def sleep(t):
return d
def _do_work(work):
- # takes work, returns list of matching nonces
+ # takes work, returns list of matching data
good = []
for i in xrange(work.nonce_start, work.nonce_end):
data = work.data[:76] + struct.pack("<I", i)
View
@@ -6,7 +6,7 @@
from util import jsonrpc, deferral
from . import kernels, transports
-def run():
+def parse_args():
urls = []
miner_args = []
for arg in sys.argv[1:]:
@@ -25,8 +25,12 @@ def run():
return
miner_args2[k] = v
kernel_name = miner_args2.pop('KERNEL', 'python')
+ return kernel_name, miner_args2, urls
+
+def run():
+ kernel_name, kernel_args, urls = parse_args()
- kernel = kernels.get(kernel_name)(**miner_args2)
+ kernel = kernels.get(kernel_name)(**kernel_args)
tps = [transports.get(url, kernel.preprocess) for url in urls]
@@ -45,6 +49,7 @@ def get_work():
def got_solution(data):
for tp in tps: # XXX
tp.send_solution(data)
+
start_time = reactor.seconds()
kernel.start(get_work, got_solution)

0 comments on commit e62c0c1

Please sign in to comment.