Update networks.py
[p2pool.git] / p2pool / data.py
index b0edf1f..3ef75f4 100644 (file)
@@ -123,7 +123,7 @@ class NewShare(object):
             pre_target2 = math.clip(pre_target, (previous_share.max_target*9//10, previous_share.max_target*11//10))
             pre_target3 = math.clip(pre_target2, (net.MIN_TARGET, net.MAX_TARGET))
         max_bits = bitcoin_data.FloatingInteger.from_target_upper_bound(pre_target3)
-        bits = bitcoin_data.FloatingInteger.from_target_upper_bound(math.clip(desired_target, (pre_target3//10, pre_target3)))
+        bits = bitcoin_data.FloatingInteger.from_target_upper_bound(math.clip(desired_target, (pre_target3//30, pre_target3)))
         
         new_transaction_hashes = []
         new_transaction_size = 0
@@ -210,7 +210,7 @@ class NewShare(object):
                 min_header=min_header,
                 share_info=share_info,
                 ref_merkle_link=dict(branch=[], index=0),
-                last_txout_nonce=last_txout_nonce*2**32,
+                last_txout_nonce=(last_txout_nonce%2**32*2**32)|(last_txout_nonce>>32), # XXX
                 hash_link=prefix_to_hash_link(bitcoin_data.tx_type.pack(gentx)[:-32-8-4], cls.gentx_before_refhash),
                 merkle_link=bitcoin_data.calculate_merkle_link([None] + other_transaction_hashes, 0),
             ))
@@ -355,8 +355,7 @@ class NewShare(object):
         
         other_txs = self._get_other_txs(tracker, known_txs)
         if other_txs is None:
-            if self.time_seen != 0: # ignore if loaded from ShareStore
-                return True, 'not all txs present'
+            pass
         else:
             all_txs_size = sum(bitcoin_data.tx_type.packed_size(tx) for tx in other_txs)
             if all_txs_size > 1000000: