Advertisement
Azelphur

Untitled

May 30th, 2011
411
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.87 KB | None | 0 0
  1.     def updateStatus(self, force=False):
  2.         #only update if last update was more than a second ago
  3.         dt = time() - self.lastUpdate
  4.         if force or dt > self.UPDATE_TIME:
  5.             rate = self.rate if (not self.miner.idle) else 0
  6.             type = " [" + str(self.connectionType) + "]" if self.connectionType is not None else ''
  7.             status = (
  8.                 "[" + formatNumber(rate) + "hash/sec] "
  9.                 "[" + str(self.accepted) + " Accepted] "
  10.                 "[" + str(self.invalid) + " Rejected]" + type)
  11.             self.say(status)
  12.             self.lastUpdate = time()
  13.             # begin phstats extra lines
  14.             statfile = file('/dev/shm/phstats', 'w')
  15.             statfile.write(formatNumber(rate) + " " + str(self.accepted) + " " + str(self.invalid))
  16.             statfile.close()
  17.             # end phstats extra lines
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement