Skip to content
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
4 changes: 3 additions & 1 deletion qubipy/core/core_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,10 +563,12 @@ def get_monero_mining_stats(self) -> Dict[str, Any]:
response cannot be parsed as valid JSON).
"""
try:
REWARD_PER_MONERO_BLOCK = 0.6
response = requests.get(f'{MONERO_URL}{MONERO_MINING_STATS}', headers=HEADERS, timeout=self.timeout)
response.raise_for_status() # Raise an exception for bad HTTP status codes
data = response.json()
data['monero_amount_rewards'] = data['pool_blocks_found'] * 0.6
raw_rewards = data.get('pool_blocks_found', 0) * REWARD_PER_MONERO_BLOCK
data['monero_amount_rewards'] = round(raw_rewards, 8)
return data
except requests.RequestException as E:
raise QubiPy_Exceptions(f"Error when getting the monero mining stats: {str(E)}") from None
Expand Down