raise ValueError('unknown result from chain.accept - %r' % (res,))
w = dict(current_work.value)
- w['highest_p2pool_share'] = w['current_chain'].get_highest_share()
+ w['highest_p2pool_share2'] = w['current_chain'].get_highest_share2()
current_work.set(w)
-
- return bitcoin_p2p.block_hash(block['header']) <= net.TARGET_MULTIPLIER*conv.bits_to_target(block['header']['bits'])
@defer.inlineCallbacks
def getBlocksCallback2(chain_id_data, highest, contact):
return False
share = p2pool.Share(header=header, txns=transactions)
try:
- return p2pCallback(share)
+ p2pCallback(share)
except:
print
print 'Error processing data received from worker:'
traceback.print_exc()
print
return False
+ else:
+ return True
reactor.listenTCP(args.worker_port, server.Site(worker_interface.WorkerInterface(current_work, compute, got_response)))
def handle_share0s(self, chains):
for chain in chains:
for hash_ in chain['hashes']:
- self.node.handle_share_hash((chain['chain_id']['previous_p2pool_block'], chain['chain_id']['bits']), hash_)
+ self.node.handle_share_hash(p2pool.chain_id_type.pack(chain['chain_id']), hash_)
def handle_share1s(self, share1s):
for share1 in share1s:
hash_ = bitcoin_p2p.block_hash(share1['header'])
self.addr_store[host, port] = services, old_first_seen, max(old_last_seen, timestamp)
else:
self.addr_store[host, port] = services, timestamp, timestamp
+
+
+ def handle_share_hash(self, chain_id_data, hash):
+ print (chain_id_data, hash)
if __name__ == '__main__':
p = random.randrange(2**15, 2**16)