Skip to content

Commit

Permalink
Display total hashrate
Browse files Browse the repository at this point in the history
  • Loading branch information
revoxhere authored Feb 8, 2021
1 parent b96d62a commit aa50b6c
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions Wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,14 +709,6 @@ def openStats(handler):
textFont3 = Font(statsWindow, size=14, weight="bold")
textFont = Font(statsWindow, size=12, weight="normal")

Label(
statsWindow,
text="YOUR MINERS",
font=textFont3,
foreground=foregroundColor,
background=backgroundColor,
).grid(row=0, column=0, columnspan=2, sticky=S + W, pady=5, padx=5)

Active_workers_listbox = Listbox(
statsWindow,
exportselection=False,
Expand All @@ -731,10 +723,12 @@ def openStats(handler):
row=1, columnspan=2, sticky=N + E + S + W, pady=(0, 5), padx=5
)
i = 0
totalHashrate = 0
for threadid in statsApi["Miners"]:
if username in statsApi["Miners"][threadid]["User"]:
software = statsApi["Miners"][threadid]["Software"]
hashrate = str(round(statsApi["Miners"][threadid]["Hashrate"] / 1000, 2))
totalHashrate += float(hashrate)
difficulty = str(statsApi["Miners"][threadid]["Diff"])
shares = (
str(statsApi["Miners"][threadid]["Accepted"])
Expand Down Expand Up @@ -767,6 +761,14 @@ def openStats(handler):
Active_workers_listbox.select_set(32)
Active_workers_listbox.event_generate("<<ListboxSelect>>")

Label(
statsWindow,
text="YOUR MINERS - " + str(totalHashrate) + " kH/s",
font=textFont3,
foreground=foregroundColor,
background=backgroundColor,
).grid(row=0, column=0, columnspan=2, sticky=S + W, pady=5, padx=5)

Label(
statsWindow,
text="RICHLIST",
Expand Down

0 comments on commit aa50b6c

Please sign in to comment.