expand debugging messages in Tracker.think and status line
authorForrest Voight <forrest@forre.st>
Thu, 11 Aug 2011 06:07:03 +0000 (02:07 -0400)
committerForrest Voight <forrest@forre.st>
Thu, 11 Aug 2011 06:07:03 +0000 (02:07 -0400)
p2pool/data.py
p2pool/main.py

index 2bff4e2..8b71136 100644 (file)
@@ -323,6 +323,8 @@ class OkayTracker(bitcoin_data.Tracker):
         for bad in bads:
             assert bad not in self.verified.shares
             assert bad in self.heads
+            if p2pool.DEBUG:
+                print "BAD", bad
             self.remove(bad)
         
         # try to get at least CHAIN_LENGTH height for each verified head, requesting parents if needed
@@ -352,8 +354,10 @@ class OkayTracker(bitcoin_data.Tracker):
         
         
         if p2pool.DEBUG:
-            print len(self.verified.tails.get(best_tail, []))
-            for h in scores:
+            print len(self.verified.tails.get(best_tail, [])), '\\/\\/\\/\\/\\/'
+            if len(scores) > 10:
+                print '    ...'
+            for h in scores[-10:]:
                 print '   ', format_hash(h), format_hash(self.verified.shares[h].previous_hash), (
                     self.verified.get_work(self.verified.get_nth_parent_hash(h, min(5, self.verified.get_height(h)))),
                     ht.get_min_height(self.verified.shares[h].previous_block),
index f001cdc..147c2af 100644 (file)
@@ -536,9 +536,11 @@ def main(args):
                         matching_in_chain = counter(current_work.value['best_share_hash'], height)
                         shares_in_chain = my_shares & matching_in_chain
                         stale_shares = my_shares - matching_in_chain
-                        print 'Pool: %sH/s in %i shares Recent: %.02f%% >%sH/s Shares: %i (%i stale) Peers: %i' % (
+                        print 'Pool: %sH/s in %i shares (%i/%i verified) Recent: %.02f%% >%sH/s Shares: %i (%i stale) Peers: %i' % (
                             math.format(att_s),
                             height,
+                            len(tracker.verified.shares),
+                            len(tracker.shares),
                             weights.get(my_script, 0)/total_weight*100,
                             math.format(weights.get(my_script, 0)/total_weight*att_s),
                             len(shares_in_chain) + len(stale_shares),