Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/getPool timeout for AVR miner #1142

Merged
merged 1 commit into from
Dec 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions AVR_Miner.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
"""
Duino-Coin Official AVR Miner 2.74 © MIT licensed
Duino-Coin Official AVR Miner 2.75 © MIT licensed
https://duinocoin.com
https://github.com/revoxhere/duino-coin
Duino-Coin Team & Community 2019-2021
Expand Down Expand Up @@ -93,9 +93,9 @@ def port_num(com):


class Settings:
VER = '2.74'
SOC_TIMEOUT = 45
REPORT_TIME = 60
VER = '2.75'
SOC_TIMEOUT = 15
REPORT_TIME = 120
AVR_TIMEOUT = 4 # diff 6 * 100 / 196 h/s = 3.06
BAUDRATE = 115200
DATA_DIR = "Duino-Coin AVR Miner " + str(VER)
Expand Down Expand Up @@ -134,7 +134,8 @@ def fetch_pool():
"warning")
try:
response = requests.get(
"https://server.duinocoin.com/getPool").json()
"https://server.duinocoin.com/getPool",
timeout=5).json()
if response["success"] == True:
NODE_ADDRESS = response["ip"]
NODE_PORT = response["port"]
Expand Down Expand Up @@ -162,7 +163,7 @@ def load(donation_level):
f"{Settings.DATA_DIR}/Donate.exe").is_file():
url = ('https://server.duinocoin.com/'
+ 'donations/DonateExecutableWindows.exe')
r = requests.get(url)
r = requests.get(url, timeout=10)
with open(f"{Settings.DATA_DIR}/Donate.exe",
'wb') as f:
f.write(r.content)
Expand All @@ -178,7 +179,7 @@ def load(donation_level):
+ 'donations/DonateExecutableLinux')
if not Path(
f"{Settings.DATA_DIR}/Donate").is_file():
r = requests.get(url)
r = requests.get(url, timeout=10)
with open(f"{Settings.DATA_DIR}/Donate",
"wb") as f:
f.write(r.content)
Expand Down Expand Up @@ -235,7 +236,7 @@ def start(donation_level):
+ 'revoxhere/'
+ 'duino-coin/master/Resources/'
+ 'AVR_Miner_langs.json')
r = requests.get(url)
r = requests.get(url, timeout=5)
with open(Settings.DATA_DIR + '/Translations.json', 'wb') as f:
f.write(r.content)

Expand Down Expand Up @@ -675,7 +676,7 @@ def mine_avr(com, threadid, fastest_pool):
try:
ser.close()
pretty_print('sys' + port_num(com),
f"Closed COM port {com}", 'success')
f"Closed COM port {com}", 'success')
sleep(2)
except:
pass
Expand Down Expand Up @@ -956,8 +957,8 @@ def calculate_uptime(start_time):
threadid = 0
for port in avrport:
Thread(target=mine_avr,
args=(port, threadid,
fastest_pool)).start()
args=(port, threadid,
fastest_pool)).start()
threadid += 1
except Exception as e:
debug_output(f'Error launching AVR thread(s): {e}')
Expand Down