('tx', bitcoin_data.tx_type),
])
def handle_tx(self, tx):
- self.get_block.got_response(bitcoin_data.tx_type.hash256(tx), tx)
+ self.get_tx.got_response(bitcoin_data.tx_type.hash256(tx), tx)
message_block = bitcoin_data.ComposedType([
('block', bitcoin_data.block_type),
attempts_per_second = attempts//time
pre_target = 2**256//(net.SHARE_PERIOD*attempts_per_second) - 1
pre_target2 = math.clip(pre_target, (previous_share2.target2*9//10, previous_share2.target2*11//10))
- pre_target3 = math.clip(pre_target2, (0, 2**256//2**16 - 1))
+ pre_target3 = math.clip(pre_target2, (0, 2**256//2**32 - 1))
target2 = bitcoin_data.FloatingIntegerType().truncate_to(pre_target3)
print attempts_per_second//1000, "KHASH"
print "TARGET", 2**256//target2, 2**256/pre_target
@defer.inlineCallbacks
def new_tx(tx_hash):
- assert isinstance(tx_hash, (int, long))
- tx = yield (yield factory.getProtocol()).get_tx(tx_hash)
- tx_pool[bitcoin.data.tx_type.hash256(tx)] = Tx(tx, current_work.value['previous_block'])
+ try:
+ assert isinstance(tx_hash, (int, long))
+ tx = yield (yield factory.getProtocol()).get_tx(tx_hash)
+ tx_pool[bitcoin.data.tx_type.hash256(tx)] = Tx(tx, current_work.value['previous_block'])
+ except:
+ traceback.print_exc()
factory.new_tx.watch(new_tx)
def new_block(block):