added bits to block-stale punishment message
[p2pool.git] / p2pool / data.py
index 6df3e89..7c21fd8 100644 (file)
@@ -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),
             ))
@@ -348,7 +348,7 @@ class NewShare(object):
     
     def should_punish_reason(self, previous_block, bits, tracker, known_txs):
         if (self.header['previous_block'], self.header['bits']) != (previous_block, bits) and self.header_hash != previous_block and self.peer_addr is not None:
-            return True, 'Block-stale detected! %x < %x' % (self.header['previous_block'], previous_block)
+            return True, 'Block-stale detected! height(%x) < height(%x) or %08x != %08x' % (self.header['previous_block'], previous_block, self.header['bits'].bits, bits.bits)
         
         if self.pow_hash <= self.header['bits'].target:
             return -1, 'block solution'