fixed incompatibility bug with pypy
authorForrest Voight <forrest@forre.st>
Sun, 7 Jul 2013 07:58:36 +0000 (03:58 -0400)
committerForrest Voight <forrest@forre.st>
Sun, 7 Jul 2013 07:58:48 +0000 (03:58 -0400)
p2pool/util/math.py
p2pool/work.py

index 04ed3ff..6ceb9ff 100644 (file)
@@ -230,3 +230,8 @@ class RateMonitor(object):
             self.first_timestamp = t
         else:
             self.datums.append((t, datum))
+
+def merge_dicts(*dicts):
+    res = {}
+    for d in dicts: res.update(d)
+    return res
index df9f787..5534b01 100644 (file)
@@ -68,7 +68,7 @@ class WorkerBridge(worker_interface.WorkerBridge):
             merged_proxy = jsonrpc.HTTPProxy(merged_url, dict(Authorization='Basic ' + base64.b64encode(merged_userpass)))
             while self.running:
                 auxblock = yield deferral.retry('Error while calling merged getauxblock:', 30)(merged_proxy.rpc_getauxblock)()
-                self.merged_work.set(dict(self.merged_work.value, **{auxblock['chainid']: dict(
+                self.merged_work.set(math.merge_dicts(self.merged_work.value, {auxblock['chainid']: dict(
                     hash=int(auxblock['hash'], 16),
                     target='p2pool' if auxblock['target'] == 'p2pool' else pack.IntType(256).unpack(auxblock['target'].decode('hex')),
                     merged_proxy=merged_proxy,